Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-288

Redundant computation in hashCode() implemenation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.21.0
    • None
    • None
    • Incompatible change, Reviewed

    Description

      In some hashCode() implementation (e.g. Block.hashCode()), the formula has the form

      37 * 17 + f(x),
      

      where f( x ) is some function. Adding 37*17 to f( x ) shifts the value of f( x ). It is not effective to do shifting in hash functions. The computation is redundant.

      Attachments

        1. h288_20090820.patch
          2 kB
          Tsz-wo Sze

        Issue Links

          Activity

            People

              szetszwo Tsz-wo Sze
              szetszwo Tsz-wo Sze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: