3 ms·
Do you have a source for that 10x number? I don't understand why a just-in-time java compiler would produce slower code than an ahead-of-time c++ compiler, esp
by 0x0 12y ago
Do you have a source for that 10x number?
I don't understand why a just-in-time java compiler would produce slower code than an ahead-of-time c++ compiler, especially since the java compiler has much more information available (exact cpu revision, cache and ram sizes, and hot spot profiling).
- mike_hearn 12y agoJava has certain qualities that make it sometimes harder to optimise, which is one reason it relies so heavily on profile guided optimisation. For example, it's very vulnerable to GC stalls if escape analysis can't identify all your variables as eligible for stack allocation. Escape analysis is complex and a little fragile, from what I've heard (I never tested it myself).
- pjmlp 12y ago> Escape analysis is complex and a little fragile, from what I've heard (I never tested it myself). Depends which JVM you are talking about. For example Graal is more aggressive than Hotspot in selecting variables for escape analysis. Each JVM (IBM, HP, Aonix, ...) has different quality levels in escape analysis.