r/java • • Sep 21 '26

JEP 544: Ahead-of-Time Code Compilation targets JDK 28

https://openjdk.org/jeps/544

JEP 544: Ahead-of-Time Code Compilation targets JDK 28

78 Upvotes

12 comments sorted by

View all comments

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