by SemanticStrengh · 4y ago · 0 comments
It already happened, that is what JIT caches with PGO feedback are all about, available out of the box in Android (yeah I know it isn't really Java), OpenJDK since version 9, OpenJ9 since ages, and on commercial JDKs like PTC, Jamaica, J/Rockit, since begining of the century.
.NET introduced PGO feedback around .NET Framework 4.6, but until now it has been quite hard to make use of, and there are some improvements coming up on .NET 7 to make it more automatic without the need to explicitly call some runtime APIs.
.NET has tiered compilation. https://docs.microsoft.com/en-us/dotnet/core/runtime-config/...
>JIT caches .NET has a native image cache. https://docs.microsoft.com/en-us/dotnet/standard/managed-exe...
>automatic vectorization
NET has automatic vectorization. https://docs.microsoft.com/en-us/cpp/parallel/auto-paralleli...
>devirtualization .NET suports both inlining and devirtualization. https://devblogs.microsoft.com/dotnet/performance-improvemen...
So, basically, none of the downsides you think about exist.
Maybe I do know one thing or two about what .NET is lacking versus Java in JIT/AOT department.
And whatever gains you get from that have to offset the fact that these languages incite patterns that are generally awful for cache coherency, and generate a lot of garbage.
Some C# microbenchmarks MAYBE could become faster than C++ in the future, but actual programs I think is extremely unlikely.
Wtf why?? Have you even the slightest idea if the breadth and the depth of a program's possible execution paths? It's a combinatorial explosion as show the difficulty and time of partial fuzzing.
Don’t hold your breath. The Java community has been trying to do that forever and no cigar. C/C++ is still the #1 language for high-performance software. Developers who hasn’t worked on high-performance software always underestimate how hard it is to compete with C/C++ when it comes to raw performance. Which is why new high-performance projects are started every day using C/C++.