|
|
|
|
|
by cogman10
271 days ago
|
|
The Java JIT and most other Javascript jits are essentially operating the same way. The core difference is the java language spec sets up a whole bunch of requirements that need to be figured out at startup and are easy to trigger. For example, static initialization on classes. The JDK has a billion different classes and on startup a not insignificant fraction of those end up getting loaded for all but the simplest applications. Essentially, Java and the JS jits are both initially running everything interpreted and when a hot method is detected they progressively start spending the time sending those methods and their statistics to more aggressive JIT compilers. A non-insignificant amount of time is being spent to try and make java start faster and a key portion of that is resolving the class loading problem. |
|
All commercial JVMs have had JIT caches for quite some time, and this is finally also available as free beer on OpenJDK, thus code can execute right away as if it was an AOT language.
In some of those implementations, the JIT cache gets updated after each execution taking into account profiling data, thus we have the possibilitiy to reach an optimal status across the lifetime of the executable.
The .NET and ART cousins also have similar mechanisms in place.
Which I guess is what your last sentence refers to, but I wasn't sure.