3 ms·
There are also many optimizations that a JIT can do that cannot be done with a static compiler.
by runT1ME 16y ago
There are also many optimizations that a JIT can do that cannot be done with a static compiler.
- rbanffy 16y agoThe optimizations will basically claim back the inefficiencies introduced by the compiler/vm stack. I am not sure those run-time optimizations allow you to beat reasonably optimal C++ code. Remember that many JIT optimizations apply only to interpreted code and would not be required with native code.
- runT1ME 16y ago>Remember that many JIT optimizations apply only to interpreted code and would not be required with native code. No, I'm talking about things like being able to skip virtual table lookups for method calls, you can't do that in C++. You can't short circuit them either. You can in a JIT. You also get superior garbage collection performance with a JIT compared to static compiling.
- beagle3 16y agoMany of them are possible in theory. Few are implemented in practice, and even fewer apply in code found in the wild. e.g. promoting an Integer[] array to an int[] array is something that Java will not do, although in some cases it is theoretically possible (and LuaJIT2 comes close to doing something equivalent).