4 ms·
>but HotSpot seems so dramatically far ahead and the distance is increasing. Benchmarkgame scores reached basically parity between java and C# once .net core 2
by jackmott 9y ago
>but HotSpot seems so dramatically far ahead and the distance is increasing.
Benchmarkgame scores reached basically parity between java and C# once .net core 2.0 dropped
.NET selling points:
* you can do some SIMD explicitly, more is coming
* you have control over when things are stack allocated or not. structs, stackalloc, slices
* you have unsigned ints
- peoplewindow 9y agoHm, seems like the big win for C# was actually someone going in and optimising the benchmark programs themselves: http://anthonylloyd.github.io/blog/2017/08/15/dotnetcore-performance http://anthonylloyd.github.io/blog/2017/08/15/dotnetcore-per... The point of explicit control is usually performance though. So if Java can give you near equal or better performance but without the developer having to explicitly specify as much, isn't that a win? Benchmark game also lacks the benchmark the Mono blog post is all about - developer iteration time.
- int_19h 9y agoIn many cases, Java actually can't give you near equal or better perf. "Our optimizer is smart enough, you don't need to care about stack-allocating things" has been the promise for as long as Java existed, but it doesn't really deliver that outside of fairly simple cases (which are also the ones that are typically benchmarked).
- sanxiyn 9y agoJava's new partial escape analysis should help with that.
- jackmott 9y ago>So if Java can give you near equal or better performance but without the developer having to explicitly specify as much, isn't that a win? It would be, but often times the lack of explicit control causes you to need more verbosity in Java to get around it, because the JIT isn't all knowing. For instance say you want an array of 2D vectors (x,y) and you want them in line in the array for data locality. In C# you just make Vector a struct, and put the structs in the array. In Java you would have to just put float primitives in the array and alternate the x and y and keep track of it by hand. Minecraft suffers greatly from this. As well, Java won't do anything but the most trivial automatic vectorization, and only on integers, and SIMD can be a huge win at times. I'm looking forward to more complete support droping for .net >Benchmark game also lacks the benchmark the Mono blog post is all about - developer iteration time.
- sitkack 9y agoF# Single file static AoT compilation. Does the JDK support this yet?
- pjmlp 9y agoSince the early days for anyone willing to pay for commercial JDKs, only Sun was against AOT compilation. For those that rather use only OpenJDK, there is Linux x64 AOT support on Java 9, with improved support for other platforms in Java 10 roadmap, some of it already in master. As for F#, currently it is lacking some love from.NET Framework, UWP and Visual Studio teams, which always think about C# and VB.NET terms. Even C++ seems to be better supported.
- guelo 9y agoI would say Scala is on par with F#. And there's also Kotlin if you're looking to transition a Java team to a static FP language more gently. And there's Clojure if you prefer a dynamic Lisp.