JDK-8209120 : Archive the Integer.IntegerCache
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-08-08
  • Updated: 2019-09-10
  • Resolved: 2018-08-13
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 11 JDK 12
11.0.6Fixed 12 b07Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Archiving the IntegerCache into the CDS archive turns out to be profitable.

Experiments shows ~1M fewer instructions in the default case (<0.5ms), with an implementation that deals gracefully with cases where a larger or smaller cache than archived has been requested.

In case a larger cache is archived and then requested, the gain is greater since the loading/mapping of the cache happens in constant rather than linear time, observing a ~150ms speedup on something like this:

java -Xshare:dump -Djava.lang.Integer.IntegerCache.high=65535
java -Xshare:on -Djava.lang.Integer.IntegerCache.high=65535 HelloWorld
Comments
Fix Request Backporting this patch helps further improve JDK 11 startup time when the default CDS archive is enabled. Patch applies cleanly to 11u on top of JDK-8207263 patch.
14-08-2019