Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12157

Replace implementation of StringMapDefaultHash::operator() with Murmur3.

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.5
    • 2.5.4
    • Internal Code, Performance
    • None

    Description

      The existing hash function used for StringMap has a very high collision rate for text names that vary by only a few characters; particularly suffixes. Running the Smhasher benchmark's text and performance tests shows that Murmur3 is superior in terms of collisions and comparable in terms of performance for short keys (and superior for long keys).

      So, the task of this ticket is to replace the current implementation with Murmur3. I recommend doing this by making StringDataDefaultHash a typedef of StringData::Hasher, and changing the implementation of SD::Hasher::operator() as follows:

      On platforms where size_t is 32-bit, we should use MurmurHash3_x86_32. Where it is 64 bits, we should use MurmurHash3_x64_128 and keep the low order 64 bits.

      Attachments

        Activity

          People

            davide.italiano Davide Italiano
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: