4 ms·
Compiling takes time, so there is a built in tradeoff to doing a JIT compilation, if you compile the wrong thing the code slows down. In JavaScript at least co
by cwmma 4y ago
Compiling takes time, so there is a built in tradeoff to doing a JIT compilation, if you compile the wrong thing the code slows down. In JavaScript at least code needs to be monomorphic to be compiled so if something is almost always called with one type, but occasionally another you can get a massive slowdown (at least in the past I'm assuming this is still the case).
More generally all the profiling and whatnot is much more complicated and so everything that entails.
- smcl 4y agoI think the pros/cons of JIT compilation are pretty well known by now, and there's enough expertise floating around that they'd probably be able to implement it in a way that doesn't compromise performance. If I recall one of reasons it wasn't pursued in CPython was that Guido wanted it to be kept relatively simple, and JIT compilation might require some fairly complex additions to CPython which is otherwise relatively simple and easy-to-understand
- klyrs 4y agoMy hope is that the Python team can keep it snappy by default so we don't end up with another Julia. And don't get me wrong, Julia is cool, but the primary drawback is its warmup time. And besides the adoption momentum that Python has, this is the main differentiator in my mind. But Julia's warmup time should serve as a warning: the expertise you claim exists has not saved major projects from the drawbacks of JIT.
- coldtea 4y agoJulia's JIT is not typical. It compiles everything, not doing it piecemeal and smartly with different "execution" layers (like, say v8). It's also based on LLVM, which historically has been slow and crap for JIT work. There are Jitted languages that run circles on top of Python on running time and even startup time.
- coldtea 4y ago>In JavaScript at least code needs to be monomorphic to be compiled so if something is almost always called with one type, but occasionally another you can get a massive slowdown (at least in the past I'm assuming this is still the case). Iirc, V8 has several layers of smarts to deal with this.