JDK-8244288 : Specialized implementations for putIfAbsent, merge, compute* methods in TreeMap derived maps
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-05-03
  • Updated: 2022-09-14
  • Resolved: 2020-08-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b11Fixed
Related Reports
Relates :  
Relates :  
Description
Specialized implementations for putIfAbsent, merge, compute, computeIfAbsent and computeIfPresent in TreeMap class were created (JDK-8176894). However, derived maps like TreeMap.descendingMap(), TreeMap.subMap(), TreeMap.headMap(), etc. still have default implementation. It looks fairly straightforward to provide these implementations.
Comments
Crazy Martin would have preferred LockStep.java to not have been modernized.
11-08-2020

The commit message mistakenly refers to the incorrect issue. Commit: http://hg.openjdk.java.net/jdk/jdk/rev/66992d8c1441 User: tvaleev Date: 2020-08-10 16:14:03 +0000 Actual message: 8247605: Avoid array allocation when concatenating with empty string Reviewed-by: redestad, plevart Intended message: 8244288: Specialized implementations for putIfAbsent, merge, compute* methods in TreeMap derived maps Reviewed-by: psandoz
11-08-2020

I believe the change was mistakenly pushed under wrong bug ID: https://hg.openjdk.java.net/jdk/jdk/rev/66992d8c1441
10-08-2020

Yes. It's a reasonable expectation that derived maps have very similar performance characteristics to their base map.
03-05-2020