I did some tests on different integer mixing functions and power of two hash tables. I tried the ones by thomas wang, bob jenkins and something I constructed out of MurmurHash (references on google). They all generate much less uniform distributions than modulo prime. When hashing strings (the content) the story is different. However, that only helps for the shared string table. I think it would be reasonable to conduct some more experiments...
arne
On Sat, 19 Mar 2011, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
And not least, xor is a lot faster. I've gathered the general consesus today is that hash quick functions are much better than mathematically pleasing ones.
E.g. all those prime modulos for hash tables in pike are probably performance killers. We ought to replace them by plain power-of-two sizes and simple masking.