Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8209120

Archive the Integer.IntegerCache

XMLWordPrintable

    • b07

        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

              redestad Claes Redestad
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: