r/foojay • • 17d ago

JEP 515 stores method profiles in the AOT cache, with mixed long-run results

On Foojay, Sven Woltmann looks at JEP 515, which since Java 25 stores the method profiles from the training run in the AOT cache, so the JIT compiler can use them right after startup.

In his javac example, rounds 2 to 5 take 14% less time on Java 25 with the profiles than without. In the long run, the program becomes 5% slower with the profiles than without a cache after 200 rounds on Java 28. He traced the cause to the JVM source code: the profiles lose their lambda entries when the cache is written, so C2 no longer inlines those lambdas.

The article also covers how to get the profiles into the cache, how to switch them off for comparison, and how long the training run should be.

https://foojay.io/today/ahead-of-time-method-profiling/

Java #JVM #AOT

3 Upvotes

1 comment sorted by

2

u/pjmlp 17d ago

Interesting would be to see the differences against existing AOT caches, like what is available on OpenJ9 and Azul.