[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Interning strings considered harmful (somewhat)
- From: Florian Weimer <fw@...>
- Date: Tue, 17 Nov 2009 18:06:13 +0100
* 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.