5 ms·
I think it is pretty obvious. Native languages are expected to be faster than interpreted or jitted, or automatic-memory-management languages in 99.9% of cases,
by ports543u 2y ago
I think it is pretty obvious. Native languages are expected to be faster than interpreted or jitted, or automatic-memory-management languages in 99.9% of cases, where the programmer has far less control over the operations the processor is doing or the memory it is copying or using.
- baq 2y agoIt isn't obvious at all. A jit compiler has access to information that an aot compiler can only dream of. There aren't many languages which have both jit and aot compilers, though.
- ahoka 2y agoJava, C#?
- baq 2y agoyeah, that isn't 'many' and e.g. in java's case hotspot is a rather nice piece of engineering
- consteval 2y ago> A jit compiler has access to information that an aot compiler can only dream of If you know the machine and platform ahead of time, not really. For frontend JS this isn't the case. But for backend code it absolutely is the case. Sure, theoretically the JIT can sit in the background, see which functions are called the most and how they're call and then re-JIT pieces of code. In practice, I'm not sure how often this is done and if you even gain much performance. You MIGHT in a dynamically typed lang like JS because you can find out a bunch of info at runtime. In something like C# though? You already know a bunch at compile-time.
- neonsunset 2y agohttps://devblogs.microsoft.com/dotnet/performance-improvements-in-net-8/#tiering-and-dynamic-pgo https://devblogs.microsoft.com/dotnet/performance-improvemen...