By: Linus Torvalds (torvalds.delete@this.linux-foundation.org), July 12, 2013 10:14 am
Room: Moderated Discussions
⚛ (0xe2.0x9a.0x9b.delete@this.gmail.com) on July 12, 2013 10:48 am wrote:
>
> The primary goal of JIT is to achieve better performance via code specialization.
> That's the only thing that can beat static compilation.
Nobody sane believes the "JIT can beat static compilers" fairy tales.
JIT's have other advantages. Performance isn't one of them. They need to get close enough, the "beating static compilers" thing was always just a dream, backed up by benchmarks that were completely unrealistic.
The real advantage of JIT is handling stuff that traditional compilers aren't good at. Particularly cross-architecture code, but also languages that are (mis-)designed to not have sufficient static information, and where you need to do a lot of decisions at runtime.
Look around you, and ask yourself where people use JIT's. It's used as a higher-performance alternative to languages that were designed for being interpreted (which are often very dynamic in their data types, since for interpretation that is very natural and makes things easier for users) and for architecture-neutral languages (ie Java VM and variations like Dalvik, but also things like OpenGL and DirectX shader languages etc).
So forget the "JITs perform better" crap. It's a bedtime story for retarded gerbils. The real story is "JITs can perform well enough, and have advantages in other areas".
They have their own set of disadvantages too, so it's not an "either or" situation. We'll continue to see both, anybody that tells you otherwise is lying.
Linus
>
> The primary goal of JIT is to achieve better performance via code specialization.
> That's the only thing that can beat static compilation.
Nobody sane believes the "JIT can beat static compilers" fairy tales.
JIT's have other advantages. Performance isn't one of them. They need to get close enough, the "beating static compilers" thing was always just a dream, backed up by benchmarks that were completely unrealistic.
The real advantage of JIT is handling stuff that traditional compilers aren't good at. Particularly cross-architecture code, but also languages that are (mis-)designed to not have sufficient static information, and where you need to do a lot of decisions at runtime.
Look around you, and ask yourself where people use JIT's. It's used as a higher-performance alternative to languages that were designed for being interpreted (which are often very dynamic in their data types, since for interpretation that is very natural and makes things easier for users) and for architecture-neutral languages (ie Java VM and variations like Dalvik, but also things like OpenGL and DirectX shader languages etc).
So forget the "JITs perform better" crap. It's a bedtime story for retarded gerbils. The real story is "JITs can perform well enough, and have advantages in other areas".
They have their own set of disadvantages too, so it's not an "either or" situation. We'll continue to see both, anybody that tells you otherwise is lying.
Linus