You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We just added this in Elide at our latest release, beta3. We embed kotlinc too. I'd love to follow this issue because we haven't addressed processors/classloading just yet. Although javac is built in native mode, we also embed support for Espresso, so I was thinking maybe we could use that to bridge, or alternatively the JNI invocation API.
Javac is embedded as-is, and accepts identical command line flags. We also ship a Maven installer for good measure; dependencies can be added via Apple's Pkl dialect and soon via pom.xml.
If you find this interesting, we can work on making it stable in the ways that are important to you. Let me know!
Run elide javac -help for help. Local JDK required; JDK up to 24 supported (in theory).
Initial findings show this is about 20x faster than stock javac for projects that tend toward smaller class compilation cycles. @simonis wrote some benchmarks (here) which show performance converging for JIT around 10k classes, so perhaps native-imaged javac is an optimal route for projects that don't meet that threshold, or don't meet it regularly.
selhagani
changed the title
AOT-compile javac and ship it with the jdk distribution
[GR-65445] AOT-compile javac and ship it with the jdk distribution
May 29, 2025
Feature request
It would be great to make javac faster, and it looks like GraalVM could improve it.
The idea is that JDK image could include the compiled binaries for javac, so the users do not spend time on JIT-compiling javac.
Describe the solution you'd like.
Build native images for javac, and include them into jdk image.
It might be that
-processor
would require classloading, sojavac
should be modified to fallback to the current Java-based implementation.I believe it could be completely transparent for the end-users.
Describe who do you think will benefit the most.
Java developers.
Describe alternatives you've considered.
One could consider building native-images on their own, however, the users would have to build images for every jdk distribution.
Express whether you'd like to help contributing this feature
I might be interested in contributing (code, benchmarks)
The text was updated successfully, but these errors were encountered: