JEP 483 AOT cache for Scala compiler

JEP 483 introduces the concept of an AOT cache. When JVM projects run their integration tests, an aot recording can be made; and this recording can be used for the creation of an AOT cache which contains classes in an already loaded and linked form. This cache can be used for subsequent runs of the same application.
It seems that especially commandline utilities have a lot to benefit from this, because they always have to warm up again with every new JVM invocation. Are there any plans to experiment with this feature to improve startup time of the Scala compiler?

2 Likes

so a workflow that could work is creating an aot cache for each classpath (per project) which then could avoid keeping classloaders in memory with a server.

1 Like

The current JEP only addresses loading the classes, e.g. JIT compiled code is still wiped on shutdown - the doc says future improvements might cache JIT compiled code

the doc says future improvements might cache JIT compiled code

Fascinating. Back in 1998 (not a typo), the Symantec JIT team (which made the fastest Java JIT at the time), was working on caching JIT output between runs. I don’t know why this hasn’t managed to materialize in the last 27 years.

1 Like