4 ms·
I remember asking the same question about Java many years ago. Some optimizations become much easier in the actual running environment. You know the hardware s
by olau 5y ago
I remember asking the same question about Java many years ago.
Some optimizations become much easier in the actual running environment. You know the hardware so don't have to cater to lowest common denominator, and you know what's actually happening and don't have to guess.
Profile-guided optimizations later showed up to bridge some of the gap, but I think JITs are typically built with a different mind set, so there are some things they excel at.
A funny example is something like a regexp matcher where a JIT might take an actual regexp built on the fly, say based on a user searching for "foo bar", and optimize code for it.