Replies: 6 comments 7 replies
-
Adding @jonahgraham and @merks to the discussion. The Eclipse packages use a pre-packaged JRE which AFAIK are based on Temurin. |
Beta Was this translation helpful? Give feedback.
-
I think it all depends on how much one would invest (in terms of initial efforts and maintenance) to safe a few (milli)seconds. For me I usually start the IDE in the morning and close it in the evening. If it takes a few seconds longer is not relevant to me. But if you are dedicated to this, the best is create a PR, show whats needed and that it works and then it might gets integrated. Also keep in mind that startup time is usually irrelevant, e.g. resolving a target from a slow server can take several decades longer and an building large projects as well. So for me time between starting the IDE and being able to start coding is the only relevant measure. Also responsiveness and speed on changes does much more affects me than the IDE taking 1 or 10 second to load. |
Beta Was this translation helpful? Give feedback.
-
Thank you for raising the topic and sharing the great analysis, @danthe1st! This is a topic we have on the list for investigation for our RCP product for quite some time, so it's great to see those refernece result based on the IDE as another RCP product. It might be true that for usual IDE setups the impact of improved startup time is not that high, but it might be different for other RCP products (like it is for ours). That's why I would not only see benefit in improving the IDE startup time but also in testing/demonstrating that and how it works for other RCP products. |
Beta Was this translation helpful? Give feedback.
-
I also tried using it with my personal Eclipse installation (based on Eclipse for Java EE and Web Developers including Lombok, Spring Tools (that actually loads Spring or parts of it, but I'm not sure whether that happens in the same JVM or in a language server JVM) and other things - my "Installed Software" tab has 124 entries).
This allows me to shave off around 1300ms with CDS or around 1900ms with AOT in that very limited test. I am not able to create an AOT archive for that Eclipse installation with JDK 24 (seems to fail due to Lombok's agent, see the following output).
|
Beta Was this translation helpful? Give feedback.
-
I also mentioned my tests on the
So it seems like AOT works best without (I guess there are some differences in my results due to me running these tests on another day.) |
Beta Was this translation helpful? Give feedback.
-
Since the first JDK 25 release candidate is out, I ran my tests with that.
Script:
Results:
With these results, I can somewhat confidently (despite my measurements not being scientific) say that AOT is better than (App)CDS is better than nothing when it comes to Eclipse startup time (and the AOT cache would likely also improve performance of the IDE in general at the beginning of a run). For RCP products that come with a JDK, I think it should be doable to ship with an AOT cache already built. Alternatively, I also think that building a CDS archive/an AOT cache if it doesn't exist (and delete it after every update) should be doable. individual startup times:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Project Leyden aims to improve startup and warmup time of Java applications.
With Eclipse being a very commonly used Open Source Java application, I think it makes sense to analyze how Eclipse can benefit from these improvements to the JDK.
Test setup
I have performed a few preliminary tests with Eclipse Platform (installed via the Eclipse Installer), Eclipse IDE for Java Developers and Eclipse IDE for Enterprise Java and Web Developers.
These tests were run with JDK 24.0.1 (Temurin) and JDK26 EA build 6.
I compared 3 different scenarios:
./eclipse/eclipse -vm $JAVA_HOME/bin/java -debug
./eclipse/eclipse -vm /home/dan1st/.sdkman/candidates/java/26.ea.6-open/bin/java -debug -vmargs -XX:+AutoCreateSharedArchive -XX:SharedArchiveFile=app.cds
consecutively but ignore the time of the first run (which creates the archive)../eclipse/eclipse -vm /home/dan1st/.sdkman/candidates/java/26.ea.6-open/bin/java -debug -vmargs -XX:AOTConfiguration=app.aotconf -XX:AOTMode=record
./eclipse/eclipse -vm /home/dan1st/.sdkman/candidates/java/26.ea.6-open/bin/java -debug -vmargs -XX:AOTConfiguration=app.aotconf -XX:AOTMode=create -XX:AOTCache=app.aot
./eclipse/eclipse -vm /home/dan1st/.sdkman/candidates/java/26.ea.6-open/bin/java -debug -vmargs -XX:AOTCache=app.aot
and measure the timeI ran these tests on Kubuntu 25.04.
Note that my system is very noisy.
Due to the
-debug
parameter, Eclipse prints the startup time in a line starting withApplication started in :
. This is what I used here.Java versions:
My expectations
My results
For every combination of Eclipse installation and JDK version, I marked the best installation type (by average time) in bold.
It seems like using AppCDS consistently results in faster startup of Eclipse compared to not using it.
With the JDK 26 EA build, it seems like CDS and AOT are pretty similar (maybe AOT failed and it "just" did CDS in the AOT archive?) but not really with JDK 24 (there were also issues creating the archive, see the next section)
With CDS (which is available with
-XX:+AutoCreateSharedArchive
since JDK 19), I got an ~500-1000ms startup improvement which seems pretty good.Issues
The
create
face of the AOT phase didn't run cleanly but the errors were "worse" with JDK 24. In both cases, it did create a "usable" archive but (at least with JDK 24) it couldn't process a lot of it as it seems.With JDK 26, I am getting similar logs to:
With JDK, I am getting a lot of warnings (even without
-Xlog:aot
) like and it takes a comparatively long time to create:See the following output with
-Xlog:aot
(the order ofstdout
andstderr
might be a bit messed up due to me using2>&1 | xclip -selection clipboard
):AOT_logs_26ea.txt
AOT_logs_24.txt
Discussion
I think it would be good if more people test these things.
If CDS results is a general improvement for most people, it might be a good idea to eventually add the CDS option to the
eclipse.ini
by default. However, care should be taken with lombok (it strikes/causes issues once more) as that attaches an agent which requires the use of-XX:+UnlockDiagnosticVMOptions
and-XX:+AllowArchivingWithJavaAgent
which is unstable (it does work for me without issues but it would probably be a good idea to not enable CDS if Lombok (or any agent) is installed into Eclipse). Also, if Eclipse is updated, it might be worth considering to remove the CDS files (so that they are regenerated).If CDS gets added by default at some point, I should still be easy to disable it (e.g. if someone wants to use the AOT capabilities (which don't seem to work together with the normal CDS) or if CDS causes some issues).
For AOT, the setup is a bit more complicated. While JEP 514 simplifies that process by only requiring two commands, it's still not where it could be. I don't think AOT is ready to be used in Eclipse by default (especially since it is only available in newer JDKs and doesn't seem to provide that big of an improvement over CDS yet).
Beta Was this translation helpful? Give feedback.
All reactions