lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


* Roberto Ierusalimschy:

> (BTW, simply dropping the skip in the hash function does solve the
> "problem"; just add a "step = 1" in lstring.c to check. But it creates a
> new one: the hash function becomes too expensive for long strings.)

I went ahead and replaced the hash function with Jenkins' lookup3.c.
The impact on microbenchmarks was rather mixed.  For reading text
files line by line, with somewhat regular content, there was a small
speed-up (despite line lengths generally above 32 bytes).  Fasta was
slower, k-nucleotide was faster.  Reading large, mostly random strings
will be significantly slower, but for quite regular strings,
lookup3.c's better mixing seems to pay off.