Re: Hash Function

new topic     » goto parent     » topic index » view thread      » older message » newer message

Patrick Barnes wrote:
[snip] 
> 
> I doubt that there could be any improvement upon my hash function.
> It's *very* fast, and *very* well distributed. 

Using the War&Peace file and my hashing algo, I got an average distribution
of 1.053133 tokens per bucket with a maximum of 4.

Using the spelling checker dictionary, I get avg of 1.114220 with a max
of 5.

> Unfortunately, I'm in
> 14th(?) place because a whopping 60% of the time is spent somewhere
> else, and I haven't figured out a good way to get around it. A hash
> function isn't everything.

That's right. The hashing algo isn't everything. Mine takes less than
10% of the program's time. About 25% is taken up with token recognition.

I still have some areas to tweak. 
 
-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu