The proposal aims to maintain the dynamic nature of the Java platform while reducing the cost associated with that dynamism, which is incurred each time an application starts. The Java platform offers features like dynamic class loading, dynamic linkage, and dynamic reflection that empower developers. However, these dynamic features come at a price, as the JVM performs extensive work during application startup, such as scanning JAR files and loading class objects on demand. Consequently, larger server applications may take seconds or even minutes to start up.
The key to improving startup time lies in performing some of this work ahead of time, rather than on demand. The proposal aims to enhance startup time by capitalizing on the fact that most applications start up in a similar manner each time they are run. Additional goals of the proposal include:
- No requirement for modifications to application code, libraries, or frameworks.
- No changes needed in how applications are launched from the command line using the Java launcher, apart from command-line options directly related to this feature.
- No necessity for using tools like
jlink
orjpackage
. - Laying the groundwork for ongoing enhancements to startup time and warmup time, which is the time required for the HotSpot JVM to optimize an application’s code for peak performance.
This ahead-of-time proposal for class loading and linking builds upon a previous proposal for ahead-of-time compilation for the JVM, which is still in draft status.