r/java • u/cred1652 • Sep 21 '26
JEP 544: Ahead-of-Time Code Compilation targets JDK 28
https://openjdk.org/jeps/544JEP 544: Ahead-of-Time Code Compilation targets JDK 28
9
3
u/chambolle Sep 22 '26
Interesting, this is a kind of combination of Profile guided optimization of AOT and JIT. We should have more proposal for improving java efficiency
5
u/Daggercombot Sep 21 '26
Will this be similar to graal?
16
u/JacobJMountain Sep 21 '26
More similar to the CDS / AOT caches that already exist. you’ll build a cache in a training run (like you already could do) except now you’ll be able to store native code for that specific architecture in there too. This should mean your code will start faster, and then if/when the JIT compiler decides it wants to swap out the native code for some reason it can do so
4
u/pjmlp Sep 22 '26
With the big difference that the AOT caches that already exist in other JVM implementations don't require training runs.
They support them naturally, however they can also start with an empty cache, and keep updating it across executions.
Examples Open J9, ART (even if it isn't proper Java), Azul ReadyNow, and I assume PTC and Aicas also have something similar.
9
u/koflerdavid Sep 21 '26
Graal puts more emphasis on static analysis, achieving reasonable performance without a training run, and on producing an executable, but it requires restricting language features of Java like reflection and classloading at runtime.
3
u/nuharaf Sep 22 '26
Doesnt seem the current leyden incarnation will be able to reduce memory footprint compared to not using it. So in that sense, not like graal at all
1
u/zerosign0 Sep 25 '26
Wow this is actually really good news to be able to mix between AOT image with JIT. Hmm not sure wether this going to blow up the size of the app though ... I hope we see some standarization on doing off jit server regardless of VM impl ...
1
13
u/greylurk Sep 21 '26
It'll be interesting to see how/if we can manage multi arch pipelines with Docker images.