Uploaded image for project: 'Apache Lucy-Clownfish'
  1. Apache Lucy-Clownfish
  2. CLOWNFISH-110

Exposure of Hash iteration order allows for O(n²) blowup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Runtime
    • None

    Description

      Our Hash implementation uses open addressing with linear probing, so we're susceptible to the same performance bug that was recently discovered in Rust:

      https://github.com/rust-lang/rust/issues/36481
      http://accidentallyquadratic.tumblr.com/post/153545455987/rust-hash-iteration-reinsertion

      Short explanation: When copying entries from one hash table to another using HashIterator to read the source table, the entries are inserted in in-memory order. If the target hash table wasn't resized to the final capacity yet, this can result in quadratic behavior.

      We have a maximum fill factor of 2/3 compared to 9/10 in the Rust implementation, so this problem should be much less pronounced.

      A possible fix is to randomize the hash function (or iteration order) for each table which is closely related to CLOWNFISH-48.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nwellnhof Nikolas Wellnhofer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: