3 ms·
It can end up with direct code generation. No JIT, no interpreter, no loading a "JVM." C++ (Clang) generates LLVM, not JVM. So does Rust. Two languages wher
by davidf18 9y ago
It can end up with direct code generation. No JIT, no interpreter, no loading a "JVM." C++ (Clang) generates LLVM, not JVM. So does Rust. Two languages where performance is a requirement. As other have pointed out, any optimizations that can be preformed by the cumbersome JVM can be preformed in LLVM. But in addition, instead of using registers, the JVM uses variables on the stack frame. Why use slower hardware than the build in registers? Then there is that automatic garbage collection which can interrupt a processor randomly.
Using a JVM or CLR by MS (who with C# was making their own Java) seems cumbersome compared with direct code generation with the LLVM as intermediate code.
Apple derives $150 billion per year as an iOS phone headset company and it chose to use LLVM years ago when the processors were not nearly as powerful as today. When an Android headset even with good hardware would require 1 GB RAM, iPhones could run with better performance on 500 MB.
- kitd 9y ago> any optimizations that can be preformed by the cumbersome JVM can be preformed in LLVM That cumbersome JVM can optimise based on runtime knowledge of the characteristics of the running code. In many cases, that kind of optimisation is more effective than the static compile-time sort.
- davidf18 9y agoI am curious as to what exactly can be optimized by the JVM runtime vs. LLVM. Do you mean targeting specific machine architectures? Because LLVM can generate images for different processors (e.g., different version of Intel architectures).