4 ms·
How is the dotnet virtual machine compared to the java virtual machine? (memory use, performance, startup time)
by amelius 6y ago
How is the dotnet virtual machine compared to the java virtual machine? (memory use, performance, startup time)
- mythz 6y agoASP.NET Core (Linux/Kestrel/C#) has the fastest plain-text performance on Tech Empower benchmarks (7.3M /rps): https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=plaintext https://www.techempower.com/benchmarks/#section=data-r19&hw=... It's also one of the more full-featured web frameworks benchmarked.
- bob1029 6y agoI haven't used the JVM in a long time, but .NET Core starts up pretty damn quick from cold IL. I believe the tiered compilation approach has something to do with the fast startup + insane web benchmarks.
- amelius 6y agoDid Microsoft Research publish papers on how the dotnet virtual machine pulls this off?
- whizzter 6y agoThe reason for benchmark performance isn't related to the JIT only but rather of .NET being more "pragmatic" with memory slices(usable with stack allocs,mmap), value types and in/out/ref passing. These little things together makes the .NET code run with far less GC pressure and more cache locality like C++ code without making the code non-idiomatic (Yes, A JVM system can be written like QuestDB to achieve similar perf but it won't be idiomatic Java code). Then the Kestrel server + new ASP.NET Core runtimes takes advantage of it (for example the new JSON parsing API's are built to directly consume byte memory w/o sacrificing too much extensibility).
- pedrow 6y ago.NET has a Global Assembly Cache[0] which I think (please correct if I'm wrong) is used to pre-compile the system frameworks and so makes startup faster. [0]: https://docs.microsoft.com/en-us/dotnet/framework/app-domains/gac https://docs.microsoft.com/en-us/dotnet/framework/app-domain...
- mythz 6y agoOnly the legacy Windows .NET Framework has a Global Assembly Cache which doesn't exist in .NET Core. Although the cross-platform .NET Core runtime does get pre-installed with a number of default Microsoft packages in its local NuGet package cache.
- fctorial 6y agoWhy doesn't jvm cache the jit compilation results?
- didibus 6y agoComparable. Most likely a toss up based on your exact program characteristics and running environment.
- pjmlp 6y agoDepends. Java has several implementations between open source and commercial vendors. Likewise .NET has several ones. So depending on the benchmarks and the set of chosen runtimes you can tick the boxes either way, depending on what one wants to prove. Hence why I rather work with both.
- rodgerd 6y agoMy experience has been that there's a lot less tweaking on smaller (<4 GB) .NET VMs than equivalent Java VMs, but I don't have experience on anything larger.