2 ms·
I’ve spent days making hash tables in C. The module operator is really slow. But a bit shifting operator is much faster. Having hash tables that grow in sizes
by nojvek 9y ago
I’ve spent days making hash tables in C.
The module operator is really slow. But a bit shifting operator is much faster. Having hash tables that grow in sizes of two, or more precisely where you can just shave off some bits of a random number to get a position will yield the best performance.
In JS, hash tables need to be growable Incase they get dense. In that instance you don’t want to compute object hash again since it’s expensive. You just want a cheap, here’s the new position.