Skip to content
  • Akira TAGOH's avatar
    fcpat: Increase the number of buckets in the shared string hash table · 4a060729
    Akira TAGOH authored
    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
    4a060729