3 ms·
Yes, but bitwise AND is faster.
by dchest 14y ago
Yes, but bitwise AND is faster.
- sukuriant 14y agoCross that bridge when you get there. If you're really finding that your hash function is the slowest piece of code in a tightly bound for-loop, and it's not all the collisions you're having (from having a bad hashing function), then look into alternatives. Before that, you're doing premature optimization.
- dchest 14y agoPlease read the whole thread before replying with the "premature optimization" thing. We are talking about hash table optimizations; this commenter -- http://news.ycombinator.com/item?id=4037320 http://news.ycombinator.com/item?id=4037320 -- is asking about the cost of modulo operation.
- deleted 14y ago[deleted]