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

Redundant computation in hashCode() implemenation

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      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

            • Assignee:
              szetszwo Tsz-wo Sze
              Reporter:
              szetszwo Tsz-wo Sze

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment