Re:Fibonacci Hashing: The Optimization That the World Forgot
by vidarh on Sunday June 17, 2018 @04:21AM
(#17331433)
Yes, the author specifically points out that there are really two separate steps here: a hash function, and scaling that result down to the number of bits needed at the current number of hash slots.
He's arguing that the fibonacci approach is both faster than modulo and at the same time is better when the input is bad.
He's certainly not arguing it replaces a good hash when you can provide one.
More pointing out that if writing a general hash table implementation you need to expect bad inputs, and since you need to scale the result down anyway you might as well improve on the input if you can do so very cheaply.
He's arguing that the fibonacci approach is both faster than modulo and at the same time is better when the input is bad.
He's certainly not arguing it replaces a good hash when you can provide one.
More pointing out that if writing a general hash table implementation you need to expect bad inputs, and since you need to scale the result down anyway you might as well improve on the input if you can do so very cheaply.