Data.HashTable.hashInt seems somewhat sub-optimal

Jan-Willem Maessen jmaessen at
Thu Aug 30 08:28:28 EDT 2007

On Aug 30, 2007, at 5:08 AM, Bulat Ziganshin wrote:

> Hello Jan-Willem,
> you may be interested to read hashing papers mentioned at

Not only did I read them, I tried out the Bob Jenkins hash function!

My conclusion is that for Data.HashTable we do not generally need a  
strong hash; we need a reasonable hash that's cheap to evaluate.  The  
mulHi operation is cheap on most architectures (eg a single multiply  
on 32-bit x86).  Remember, for a hash table we're trading off hashing  
cost with the cost of chain traversal.  There are plenty of other  
applications of hashing where we need to do a better job than this.


> -- 
> Best regards,
>  Bulat                            mailto:Bulat.Ziganshin at

More information about the Libraries mailing list