This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: DT_GNU_HASH: ~ 50% dynamic linking improvement
- From: "djamel anonymous" <djam8193ah at hotmail dot com>
- To: jakub at redhat dot com
- Cc: libc-alpha at sources dot redhat dot com
- Date: Wed, 05 Jul 2006 10:07:15 +0000
- Subject: Re: DT_GNU_HASH: ~ 50% dynamic linking improvement
- Bcc:
Hello, first i thank you for your reply.the current hash function is defined
as:
static uint_fast32_t
dl_new_hash (const char *s)
{
uint_fast32_t h = 5381;
for (unsigned char c = *s; c != '\0'; c = *++s)
h = h * 33 + c;
return h & 0xffffffff;
}
with this hash function we have strings of length 1 affect only the first 8
bits, strings of length 2 affect only the first 13 bits... strings of length
4 effect only the first 23 bits.so the full 32 bits of the hash value are
affected beginning with strings of length 6 and above.
for the variant you suggested, i think using the 5 least significant bits
may solve the problem but in this case nbuckets must be odd.another solution
would be to use the bits numbered from 5 to 9.for this solution to be
effective nbuckets must not be a multiple of 64.
best regards.
_________________________________________________________________
MSN Messenger : discutez en direct avec vos amis !
http://www.msn.fr/msger/default.asp