Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-13291

Replace usages of MessageDigest with Guava's Hasher

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 4.0-alpha1, 4.0
    • Legacy/Core
    • None

    Description

      During my profiling of C* I frequently see lots of aggregate time across threads being spent inside the MD5 MessageDigest implementation. Given that there are tons of modern alternative hashing functions better than MD5 available – both in terms of providing better collision resistance and actual computational speed – I wanted to switch out our usage of MD5 for alternatives (like adler128 or murmur3_128) and test for performance improvements.

      Unfortunately, I found given the fact we use MessageDigest everywhere – switching out the hashing function to something like adler128 or murmur3_128 (for example) – which don't ship with the JDK – wasn't straight forward.

      The goal of this ticket is to propose switching out usages of MessageDigest directly in favor of Hasher from Guava. This means going forward we can change a single line of code to switch the hashing algorithm being used (assuming there is an implementation in Guava).

      Attachments

        1. CASSANDRA-13291-trunk.diff
          50 kB
          Michael Kjellman

        Issue Links

          Activity

            People

              mkjellman Michael Kjellman
              mkjellman Michael Kjellman
              Michael Kjellman
              Jason Brown
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: