Hey this is kind of a digression, related to the topic of performance and baseline profiles. And this is probably a naive question, but I was wondering: why not compiling the whole app, ahead of time? Instead of just the "hot spots"? Which need to be collected beforehand and then packaged etc. What am I missing?
l
Landry Norris
06/14/2022, 6:11 PM
The JIT compiler can use information that it gets during runtime to sometimes generate code that’s faster then AOT compiled code, especially C2, where the generated code doesn’t have to work in general. Most JVMs use tiered compilation for this reason. Because of this, I would assume the JIT is the primary way of running code, with AOT there to help startup times.