|
From: Geoff H. <ghu...@ws...> - 2003-02-03 14:51:17
|
> I'm wondering if we couldn't add a String to the Dictionary class and > use that instead of doing a malloc/strcpy everytime.. this function is > called jillions of times. That's probably a good idea. > I'm also curious as to why not use Knuth's golden ratio hash > function, > it's a well studied and known-good hash. > > I can make the change and test it.. I'm just curious about the > rational > for both the origional hash function and the change. No one really cares *what* this hash function is. I certainly don't care if it's "well studied" if it works. The "original" hash you point to was one I derived in the 3.1 betas that seemed to show the fewest bad hashes on as many test sets I could find. One catch to this hash function is that it sees a lot of URLs, which means that "classic" hash functions don't always work well. The change did seem to show performance improvements for me, though I'll admit I didn't count the number of bad hashes. I've seen lots of "well it works" hash functions used in other situations, which is what I'd say about any replacements, Knuth or not. -Geoff |