3 ms·
We're talking about optimizations that JIT can do compared to AOT. The link you shared talks about skipping compilation for certain branches to speed up the JI
by hbrn 4y ago
We're talking about optimizations that JIT can do compared to AOT.
The link you shared talks about skipping compilation for certain branches to speed up the JIT compilation. Such optimization makes startup faster, but it doesn't make code execution faster. AOT compiled languages don't have slow startup problem in the first place.
It's like saying paper books are worse than e-ink readers because you cannot charge paper books.
- kaba0 4y agoEliding a branch makes not only compilation faster, but the resulting code as well. That’s how for example some logging statements become zero-cost when the debug level is set lower than their corresponding one. JIT compiled languages don’t care too deeply about startup, they shine with longer runtimes.
- hbrn 4y agoAre you sure you're not confusing zero-cost with almost zero-cost? Even zerolog talks about negligible costs after most aggressive optimizations, not zero: https://github.com/obsidiandynamics/zerolog https://github.com/obsidiandynamics/zerolog If you're just using constants in your code to set logging level, AOT compilation can do exactly the same optimizations.
- blackoil 4y agoAOT would require recompilation and deployment. JIT can do it for the same code with final params. When the log level is not final, branch prediction Will ensure JIT code is faster.