3 ms·
You have forgotten several important analysis routinely done by JITs that significantly speedup Java: - deep inlining, by default the inlining depth of a JVM i
by _old_dude_ 9y ago
You have forgotten several important analysis routinely done by JITs that significantly speedup Java:
- deep inlining, by default the inlining depth of a JVM is around 10, you can not have this depth of inlining with a statically compiled language.
- prune non taken branches (and exception blocks),
so you do not fill the instruction cache with code never executed.
- branch re-ordering, the code executed more often can be read from top to bottom, less executed code is offloaded to a side block.
- CPU instructions selection at runtime.
- lock profiling, generate different codes if the lock is contented or not.
BTW .Net do not do any code profiling, so can not use most of these optimizations.