1. 03 Oct, 2018 6 commits
  2. 17 Sep, 2018 2 commits
    • Hans Petter Jansson's avatar
      ghash: Simplify g_hash_table_set_shift() · 171f698e
      Hans Petter Jansson authored
      Even if we're using a prime modulo for the initial probe, our table is
      power-of-two-sized, meaning we can set the mask simply by subtracting one
      from the size.
      171f698e
    • Hans Petter Jansson's avatar
      ghash: Fix poor performance with densely populated keyspaces · 0dee6297
      Hans Petter Jansson authored
      Sequential integers would be densely packed in the table, leaving the
      high-index buckets unused and causing abnormally long probes for many
      operations. This was especially noticeable with failed lookups and
      when "aging" the table by repeatedly inserting and removing integers
      from a narrow range using g_direct_hash() as the hashing function.
      
      The solution is to multiply the hash by a small prime before applying
      the modulo. The compiler optimizes this to a few left shifts and adds, so
      the constant overhead is small, and the entries will be spread out,
      yielding a lower average probe count.
      0dee6297
  3. 31 Aug, 2018 8 commits
  4. 30 Aug, 2018 7 commits
  5. 29 Aug, 2018 3 commits
  6. 28 Aug, 2018 3 commits
  7. 27 Aug, 2018 11 commits