[GR-64282] Espresso CDS: Module layer caching. #11413
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a subset of the CDS (Class Data Sharing) functionality from HotSpot into Espresso.
Ironically, there's no class meta-data included in the file since the Espresso implementation aims to speed up the creation of the boot
ModuleLayer
. HotSpot's CDS is older than Espresso itself and has accumulated additional features over time, some of which be integrated as well into Espresso.Espresso's static archive should be located by default in
JAVA_HOME/lib/truffle/classes.ejsa
.It can be generated at build time with
java -truffle -Xshare:dump
.Espresso maps HotSpot's
-Xshare:on|off|auto|dump
as--java.CDS=on|off|auto|dump
.Custom archive path can be set similar to HotSpot's
-XX:SharedArchiveFile=<path/to/classes.jsa>
using--java.SharedArchiveFile=<path/to/classes.ejsa>
.Additional logging can be enabled with
--log.java.CDS.level=ALL -Djdk.module.boot.usePerfData=debug
.Simple tests for Espresso
native-ee
standalone, power save mode (slow, but more stable):java -truffle -Xshare:off Hello
480msjava -truffle -Xshare:on Hello
233ms (48%)HotSpot for reference:
java -server -Xshare:off Hello
107msjava -server -Xshare:on Hello
66ms (61%)On Espresso JVM (cold):
espresso -Xshare:off Hello
5907msespresso -Xshare:on Hello
4838ms (81%)