by asdfjghafsdkh · 11y ago · 0 comments
Also, for sorting 64-bit integers I like to do a bitwise or of all the integers while computing the histogram. Then if the bits you are looking at are zero (plausible for unsigned 64-bit integers) you can skip to the ones that matter for the next histogram.
You could do the same thing (I think) to avoid TLB limitations, manually staging everything in a contiguous 2MB of memory (backed by one large page, say), in order to keep the radix high and do fewer full scans. If you are hitting memory bandwidth, your performance should be determined by the number of scans you end up doing.
All of this is "caveat: I just read other people's work and haven't done this myself, because I haven't figured out inline asm in Rust yet". If you have more details on engineering radix sort, I'd love to read up! :D