JEP 515: Ahead-of-Time Method Profiling

https://news.ycombinator.com/rss Hits: 10
Summary

Summary Improve warmup time by making method-execution profiles from a previous run of an application instantly available, when the HotSpot Java Virtual Machine starts. This will enable the JIT compiler to generate native code immediately upon application startup, rather than having to wait for profiles to be collected. Goals Help applications warm up more quickly by shifting the collection of initial method execution profiles from production runs to training runs, conveying the profiles via the AOT cache. Do not require any change to the code of applications, libraries, or frameworks. Do not introduce any new constraints on application execution. Do not introduce new AOT workflows, but, rather, use the existing AOT cache creation commands. Motivation To truly know what an application does, we must run it. We can draw simple conclusions about an application's behavior by inspecting its source code or its class files, but we will be uncertain about how it interacts with the highly dynamic Java Platform. One reason for this uncertainty is that, in the absence of final or sealed modifiers, any class can be subclassed at any time, so a method can be called many times and then overridden and never called again. Another reason is that new classes can be loaded in response to external input, extending the application's behavior in ways that even its author could not predict. Static analysis can always be defeated by program complexity. When running an application, the JVM can identify which methods do the important work, and how they do it. For an application to reach peak performance, the JVM's just-in-time compiler (JIT) must find the unpredictable set of hot methods, i.e., those which consume the most CPU time, and compile their bytecode to native code. (Hence the name "HotSpot JVM".) Since previous application behavior is an excellent predictor of future behavior, a summary of previous behavior can focus the JVM's compilation efforts upon the code that really matters. ...

First seen: 2025-05-11 16:23

Last seen: 2025-05-12 01:24