Hacker News new | ask | show | jobs
by Sesse__ 1152 days ago
“Superfast”, until you blow through your L1 cache, which happens pretty early on if you need 1 kB of table per byte in your key.

Even in the L1 cache, it's hard to beat the mul: A multiplication (which can hash multiple bytes in the case of Fibonacci hashing) has 3 cycles latency on modern x86. A single load, even from L1, is 5, I believe.

2 comments

How much of a problem 3 cycles of latency is depends on what else your processor is doing. It might not be any problem at all.
Word. It depends on access patterns of course but yeah, L1 is a valuable resource.