Hacker News new | ask | show | jobs
by hawk_ 1715 days ago
where does it say .net 5 was faster than openjdk? hotspot is a very sophisticated jit compiler that has probably 100 manyears put into it just in optimizations. given that .net added monomorphic/bimorphic call site devirtualization recently which is considered quite basic in the hotspot, it would be good to see real world usage comparison.
1 comments

Where required there are ways to force it to inline/devirtualise yourself. For example using refied generics is one way I've seen - i.e. there is no interface/virtual casting since it takes a type that implements interface, rather than the interface itself. It allows you to make polymorphism compile time rather than runtime. Seem comparison libraries to Java (closed source) that have run much faster as a result.

I do find people comparing Java and .NET Core often are compare apples to oranges however. Working on both languages it is just my opinion but the .NET platform is newer - it has a better "base" even without the same man hours. Much of the engineering time in both ecosystems is spent optimising for code typical to that ecosystem which is affected by history/legacy like any other software system.