|
|
|
|
|
by Xk
5757 days ago
|
|
Looks like a case of premature optimization to me. Optimizing for hash function speed when you end up with thousands of comparisons is just pathetic. Who cares if your hash function takes a whole millisecond instead of a fraction of a millisecond if it ends up that you get an equal distribution in the different buckets? (On average they're going to need to compare with 6324 other objects before they've gotten the right one. A perfect hash function would end up 5686 checks. Willing to bet that the 639 fewer checks would make up for a better hash function.) But that's just the beginning of the problem! I mean, even with a hash function that's that bad, ~100 buckets would get them nearly 10X better performance! And realistically, why not use several thousand buckets? Come on ... |
|