[m-rev.] diff: add two string hash functions

Paul Bone pbone at csse.unimelb.edu.au
Fri Nov 12 21:09:58 AEDT 2010

On Fri, Nov 12, 2010 at 01:21:07PM +1100, Zoltan Somogyi wrote:
> Until now, all hash tables on strings used a single standard hash function.
> However, any single hash function has a pretty good probability of generating
> collisions on small hash tables.
> This diff adds two new hash functions on strings. When generating hash tables,
> we now try out all three hash functions, and use the one that generates
> the fewest collisions.

Is this for strings that are constant and known at compile time?  If so is it
not better to generate perfect has functions for each switch in the way
gperf(1) does?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20101112/73846f33/attachment.sig>

More information about the reviews mailing list