-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
18
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
IdentityHashMap are a useful part of Java collections and deserves optimizations. Not only does it serve special roles of comparing by identity, compared to regular HashMap, IdentityHashMap may have smaller memory footprints and can be a faster replacement for maps between identity-based objects, such as attached extra data.
Currently, IdentityHashMap does not override a few JDK-8 methods, including getOrDefault, putIfAbsent, remove, replace, computeIfAbsent, computeIfPresent, merge. Overriding these may save a few hash table lookups and moderately boost the performance of IdentityHashMap.
Note that due toJDK-8178355, the desired behavior of remove and replace are currently under contest and will probably be addressed separately.
IdentityHashMap are a useful part of Java collections and deserves optimizations. Not only does it serve special roles of comparing by identity, compared to regular HashMap, IdentityHashMap may have smaller memory footprints and can be a faster replacement for maps between identity-based objects, such as attached extra data.
Currently, IdentityHashMap does not override a few JDK-8 methods, including getOrDefault, putIfAbsent, remove, replace, computeIfAbsent, computeIfPresent, merge. Overriding these may save a few hash table lookups and moderately boost the performance of IdentityHashMap.
Note that due to
- csr for
-
JDK-8278313 Implement JDK-8 default methods for IdentityHashMap
- Draft
- relates to
-
JDK-8178355 IdentityHashMap uses identity-based comparison for values everywhere except remove(K,V) and replace(K,V,V)
- Closed
- links to
-
Review openjdk/jdk/6532