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

Archive the Integer.IntegerCache

    Details

    • Subcomponent:
    • Resolved In Build:
      b07

      Backports

        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

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: