ConcurrentHashMap.get should check key identity before equality

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Cannot Reproduce
    • Priority: P5
    • 8
    • Affects Version/s: 6
    • Component/s: core-libs

      A DESCRIPTION OF THE REQUEST :
      The HashMap implementation short circuits the case of the same key which avoids the potentially more costly equals() comparison at the cost of an extra comparison.



      JUSTIFICATION :
      Faster when using common keys

      ACTUAL -
      Current 1.6 HashMap:

      if (e.hash == hash && ((k = e.key) == key || key.equals(k)))


      Current 1.6 ConcurrentHashMap:

      if (e.hash == hash && key.equals(e.key))

            Assignee:
            Mike Duigou
            Reporter:
            Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: