fcpat: Increase the number of buckets in the shared string hash table
authorAkira TAGOH <akira@tagoh.org>
Wed, 28 Mar 2012 04:38:53 +0000 (13:38 +0900)
committerAkira TAGOH <akira@tagoh.org>
Wed, 28 Mar 2012 04:42:01 +0000 (13:42 +0900)
commit4a060729a1466186d3be63ada344f43d66f937e5
treedbeae2e4726cd6678e9946b06d1111f3be39bc3e
parentd8dcff7b96b09748e6f1df9e4adc7ab0850d7b18
fcpat: Increase the number of buckets in the shared string hash table

This is a reasonably conservative increase in the number of buckets in the hash
table to 251.  After FcInit(), there are 240 shared strings in use on my system
(from configuration files I assume).  The hash value is stored in each link in
the chains so comparison are actually not very expensive.  This change should
reduce the average length of chains by a factor of 8.  With the reference
counted strings, it should keep the average length of chains to about 2.  The
number of buckets is prime so as not to rely too much on the quality of the
hash function.

https://bugs.freedesktop.org/show_bug.cgi?id=17832#c5

Patch from Karl Tomlinson
src/fcpat.c