4 ms·
Only hot code paths get compiled. That's after 10000 executions on "server" JVM and 1000 executions on a "client" JVM by default. This is by design, and if you
by bitcharmer 6y ago
Only hot code paths get compiled. That's after 10000 executions on "server" JVM and 1000 executions on a "client" JVM by default.
This is by design, and if you need everything compiled right away you can set the compilation threshold to 1.
I don't see any value in compiling parts of code that only gets executed during bootstrap.
- nineteen999 6y ago> I don't see any value in compiling parts of code that only gets executed during bootstrap. Not disagreeing with you there, since stopping to compile code/optimize at runtime contributes to sluggish interactive performance.
- bitcharmer 6y agoCompilation is performed concurrently to the application in specialised compilation threads. Only OSR (on-stack-replacement) requires stopping execution.
- chrisseaton 6y ago> Not disagreeing with you there, since stopping to compile code/optimize at runtime contributes to sluggish interactive performance. No JVM I am aware of stops to compile - the compiler runs on a background thread while the application continues to run as normal.
- MaxBarraclough 6y agoNitpick: the HotSpot 'client' JVM's default JIT threshold is 1500, not 1000. https://www.oracle.com/java/technologies/javase/vmoptions-jsp.html https://www.oracle.com/java/technologies/javase/vmoptions-js...
- bitcharmer 6y agoYou're right, thank you for correcting me. For more popular archs (x86, arm, aarch64) it's 1500. It's only 1000 by default for ppc, s390 and sparc. https://chriswhocodes.com/hotspot_options_jdk14.html https://chriswhocodes.com/hotspot_options_jdk14.html
- MaxBarraclough 6y agoSo we're both right! Didn't know it varied between architectures.