summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2012-03-28 13:38:53 +0900
committerAkira TAGOH <akira@tagoh.org>2012-03-28 13:42:01 +0900
commit4a060729a1466186d3be63ada344f43d66f937e5 (patch)
treedbeae2e4726cd6678e9946b06d1111f3be39bc3e
parentd8dcff7b96b09748e6f1df9e4adc7ab0850d7b18 (diff)
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
-rw-r--r--src/fcpat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fcpat.c b/src/fcpat.c
index 4b93c5e..54ec45c 100644
--- a/src/fcpat.c
+++ b/src/fcpat.c
@@ -1023,7 +1023,7 @@ bail0:
return NULL;
}
-#define OBJECT_HASH_SIZE 31
+#define OBJECT_HASH_SIZE 251
static struct objectBucket {
struct objectBucket *next;
FcChar32 hash;