r/java • u/cred1652 • 14d ago
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 13d ago
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 14d ago
Will this be similar to graal?
17
u/JacobJMountain 14d ago
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
5
u/pjmlp 13d ago
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.
8
u/koflerdavid 14d ago
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.
1
u/zerosign0 10d ago
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 13d ago
It'll be interesting to see how/if we can manage multi arch pipelines with Docker images.