4 ms·
>JIT compilation is pretty incredible. Not if you compare to AOT for languages who lack garbage collectors. C, C++, Fortran would still be quite faster.
by DeathArrow 5y ago
>JIT compilation is pretty incredible.
Not if you compare to AOT for languages who lack garbage collectors. C, C++, Fortran would still be quite faster.
- pjmlp 5y agoJIT cache is the answer, or one of the AOT compilers that exist for ages.
- kaba0 5y agoGiven sufficient time and a sufficiently expert programmer. It is not that easy to beat Java for complex programs where your workload is really variable and can’t use the usual tools like arenas.
- tsimionescu 5y agoThere are some workloads where Java's JIT can beat C, C++, Fortran AOT compilation. They are probably not very common, but stuff like un-inlining can really save on instruction cache misses in workloads where the most likely path is consistent for fixed periods of time, but changes relatively often (for something like `if COND { foo(); } else { bar(); }` in a hot loop, where COND is sometimes true for a while than false for another while). Of course, Java also has a lot of overhead from the language and implementation level, because of things like no generic lists of integers, no struct embedding leading to lots of pointer-chasing, a tendency for over-allocation, and direct overhead of the advanced JIT itself - performance counters, dummy instructions to support de/re-optimizations on the fly etc.