2 ms·
> He doesn't seem aware that, by far, the main reason for using power-of-two hash table sizes is so you can use a simple bitshift to eliminate modulo entirely.
by pacoverdi 10y ago
> He doesn't seem aware that, by far, the main reason for using power-of-two hash table sizes is so you can use a simple bitshift to eliminate modulo entirely.
[...] using a power of two to size the table so that a hash can be mapped to a slot just by looking at the lower bits.
He seems to know this bit :)
- mark-r 10y agoHe appears to know about bit masking but not bit shifting, which seems odd.