Use Java Application class data sharing (AppCDS). #4067
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.
See https://developers.redhat.com/articles/2024/01/23/speed-java-application-startup-time-appcds & https://dev.java/learn/jvm/cds-appcds/
Taking a sample of 10 runs, sorted by duration.
JDT-LS startup time (currently)
1565 1643 1656 1670 1676 1684 1694 1706 1733 1904
median ~= 1680ms
JDT-LS startup time (PR)
1400 1405 1408 1415 1450 1470 1480 1498 1522 1541
median ~= 1460ms
Note that the first startup time with the PR was 1819ms as that's when the shared archive is generated. This phase is expected to be slow.
I also tried testing this entirely within vscode-java by measuring the duration until the Java language server reports it has started and observed the following times :
JavaLanguageServerPlugin startup time (currently)
2.345 2.247 2.268 2.229
JavaLanguageServerPlugin startup time (PR)
1.849 1.906 1.793 1.843
So basically, I would expect ~10-20% improvement on just the JDT-LS runtime initial startup (often 1-2 seconds).