[PATCH] DT_GNU_HASH: ~ 50% dynamic linking improvement

Paul Eggert eggert@CS.UCLA.EDU
Wed Jun 28 19:10:00 GMT 2006


Jakub Jelinek <jakub@redhat.com> writes:

> (Dan Bernstein's string hash function posted eons ago on comp.lang.c.)

Bernstein now prefers XOR, i.e.,
"h = h * 33 ^ c;" instead of
"h = h * 33 + c;".  Did you try that as well?
Several sources indicate it's a bit better, e.g.,
<http://eternallyconfuzzled.com/tuts/hashing.html#djb2>.

> We have tested a bunch of different hash functions

Which hash functions did you try?  One-at-a-time?  FNV?  You'll
probably get hassled by hash triviists (like me :-) no matter which
function you choose, but you can forstall that to some extent by
mentioning which functions you tested.

(Thanks for doing all this, by the way.)



More information about the Libc-alpha mailing list