This is actually faster on startup (depending on the size of the jar) than running from an unexploded archive.
After startup, you should not expect any differences.
TIP: Run `java -Djarmode=tools -jar my-app.jar help extract` to see all possible options.
[[deployment.efficient.cds]]
== Optimize Startup Time with CDS
Class Data Sharing (CDS) is a https://docs.oracle.com/en/java/javase/17/vm/class-data-sharing.html[JVM feature] that can help reduce the startup time and memory footprint of Java applications.
To use it, you should first perform a training run on your application in exploded form:
NOTE: For more details about CDS, refer to the {url-spring-framework-docs}/integration/cds.html[Spring Framework reference documentation]
[[deployment.efficient.aot]]
== Using Ahead-of-time Processing With the JVM
@ -36,6 +60,8 @@ TIP: Run `java -Djarmode=tools -jar my-app.jar help extract` to see all possible
@@ -36,6 +60,8 @@ TIP: Run `java -Djarmode=tools -jar my-app.jar help extract` to see all possible
It's beneficial for the startup time to run your application using the AOT generated initialization code.
First, you need to ensure that the jar you are building includes AOT generated code.
NOTE: CDS and AOT can be combined to further improve startup time.
For Maven, this means that you should build with `-Pnative` to activate the `native` profile: