tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Perfect hash function generator



Joerg Sonnenberger <joerg%britannica.bec.de@localhost> wrote:
> I'd like to fix this issue in two steps. First, I'd like the integrate
> the Jenkins hash function into libc. It is using only simple operations
> and known to provide few collisions. It can be used with power-of-two
> hash tables as well as modular hashes. As the man page states, the
> prototype goes into string.h. The primary reason to make this libc and
> not e.g. libutil is to allow all parts of the system to use it without
> pulling in libutil. This applies e.g. to the new libterminfo.

Is it a Jenkins lookup3?  Anyway, as I already mentioned to you, there is
a MurmurHash2 (source code in the web site is under Public Domain):

http://murmurhash.googlepages.com/

Various tests show that it is faster than Jenkins, and good as a general
purpose hash. Can you deny this, or demonstrate why Jenkins is preferable
instead of MurmurHash?

> The second part is the provided minimal perfect hash function generator.
> The generated hash function is very simple, using two lookups, a Jenkins
> hash and three unsigned constant divisions. <...>

Sounds good, just do we really need this in the base? I think pkgsrc would
be a better place.

Thanks.

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index