-
Type:
Enhancement
-
Resolution: Cannot Reproduce
-
Priority:
P5
-
Affects Version/s: 6
-
Component/s: core-libs
-
sparc
-
solaris_10
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))
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))