[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A good hash algorithm
- From: Jason Evans <jasone@...>
- Date: Fri, 12 Jul 2002 14:44:09 -0700
A bit of background: I'm not actually a Lua user, but I've been reading the
list archives for about a year, since someone pointed Lua out to me as
having similar uses to Onyx, a language which I wrote
(http://www.canonware.com/).
The thread here about hashing algorithms interested me, and I ended up
trying out Bob Jenkins's hash function with Onyx. The results were
underwhelming; variations on a simple old algorithm[1] turn out to have
similar runtime performance, and significantly lower collision rates than
Jenkins's. Naturally the results depend on the inputs, but Jenkin's
algorithm was a step backward for Onyx in all of my tests, and it wouldn't
surprise me if the same is true for Lua.
Jason
[1] djb2 algorithm: http://www.cs.yorku.ca/~oz/hash.html