3 ms·
Which bytecode-based compilers actually perform real optimizations, aside from WebAssembly? Both Python and Java seem to emit "stupid" bytecode and let the JIT
by saagarjha 7y ago
Which bytecode-based compilers actually perform real optimizations, aside from WebAssembly? Both Python and Java seem to emit "stupid" bytecode and let the JIT take care of it. (And any bytecode implementation is almost always slower than native code.)
- pjmlp 7y agoAll of those that are actually compiled to native code? Optimizations done at bytecode level aren't worthwhile unless you are targeting pure interpreters. Still, there are bytecode optimizers for Java and .NET, that is part of what code obfuscators are able to do, what many toolchains for embedded devices do as packing step, and a standard step in Android builds. In what concerns JIT/AOT themselves, well having bytecodes with a kernel JIT is what has allowed IBM and Unisys to update their hardware designs, while keeping software with several decades of history to keep running. It is also what allows Android and watchOS code to transition to 64 bits without most developers even having to care about it. Or how Android, Java and .NET developers are able to take advantage of AVX auto-vectorization, string SIMD, bits operation optimizations, without having to touch their decades old binaries. It also allows the usage of cloud compilers (UWP, Android, IBM J9), which gather PGO information across multiple deployments and use it as input to the top tier JIT/AOT optimizing compilers.