Hacker News new | ask | show | jobs
by krzyk 1905 days ago
AOT can't take into consideration runtime, which might result in less efficient code compilation vs JIT.

So it is apples vs oranges. One is faster here the other there.

GC might be an issue, but for me IDEA feels fast and the added benefit of code navigation vs e.g. vim is worth it.

2 comments

But it might also result in less efficient code compilation, because the runtime overhead of some types of optimizations (especially the extremely powerful global optimizations) isn't really feasible while the app is running.

AOT + PGO really is the best of both worlds, but from a devops perspective it gets a bit tricky. But it would be a no-brainer for something like Intellij.

>AOT can't take into consideration runtime, which might result in less efficient code compilation vs JIT.

That has for decades been a "in the future we'll have flying-cars" style promise for 99% of workloads...

Sure, JIT can theoritically optimize based on runtime hints. But most of the time, for any practical use, it's slower than AOT.

JITs have been extremely successful for dynamically typed languages, but that has always been a low hanging fruit for optimization.

Once you have a static type system, the JIT doesn't bring you much over ordinary AOT compilation, and no benefit over PGO...while losing out on global optimizations that aren't feasible in a JIT.