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


On 18/11/2019 21:57, Wilco Dijkstra wrote:
> Hi Florian,
> 
> Hashtables should be powers of 2 - this not only gives very efficient

this hash table is in the elf binary,
so we are not in control of the size and other details.

> 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]