This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimizing hash table lookup in symbol binding


Hi Florian,

Hashtables should be powers of 2 - this not only gives very efficient
lookups but also enables double hashing without ever needing to use
multiply or division. If you're worried about the entropy of the low bits
you can do (x ^ (x >> 16)) & mask to mix bits before masking.

If you're looking to get the best possible speedup, this will do it.

Cheers,
Wilco

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]