upgraded vsort a bit (50-100ms)

This commit is contained in:
Richard Thier 2021-12-15 12:53:00 +01:00
parent 520db7049d
commit bff96c8f7f

View File

@ -184,7 +184,7 @@
free(buf);
}
void vsort(uint32_t *a, int n) {
static thread_local std::vector<uint32_t> bts[256];
thread_local std::vector<uint32_t> bts[256];
for (int shift = 0; shift < 32; shift += 8) {
for (int i = 0; i < n; i++) bts[a[i] >> shift & 0xff].push_back(a[i]);
for (int bt = 0, k = 0; bt < 256; bt++) {