4 ms·
Java is faster in almost any way (compared to C#). Do you have benchmarks showing i am wrong ? It also has multiple AOT compilers and a much larger eco-system.
by mtmmtm 5y ago
Java is faster in almost any way (compared to C#). Do you have benchmarks showing i am wrong ?
It also has multiple AOT compilers and a much larger eco-system.
- kaba0 5y agoC# can be faster due to exposing lower level constructs. But for complex applications/not-heavily-optimized code, the JVM will likely perform better, eg. in GC throughput definitely. There is an interesting issue on benchmarkgame’s repo, where C# is ahead a bit using a clever trick. It basically halves the required allocations. And Java is insanely close with double the allocations.
- igouy 5y ago> There is an interesting issue on benchmarkgame’s repo… No. There was an interesting issue. The clever trick was disallowed and the programs that used the clever trick were removed. > … insanely close with double the allocations… No, what you see is not with double the allocations. The clever trick was disallowed and the programs that used the clever trick were removed. Read the program source code.
- kaba0 5y agoI didn’t know that those results were removed, but nonetheless, at the time with double the allocation Java was insanely close to the “cheating” C# program.
- igouy 5y agoI doubt that your allegation of dishonesty is welcome in this forum. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- kaba0 5y agoWhat allegation? I put cheating into quotes, indicating that I by no means mean bad-faith behind it. My point was to point out how great Java’s GC is. Especially that my whole comment was actually defending C#, even though I’m not particularly fond of it.
- mtmmtm 5y agoYou did not give me a link to something saying that C# is faster (it is still not). Choosing C# only is only good if vendor lockdown is something you like (or benefit from). I have been involved in a project where C#-developers where involved (MS lockdown). The funders asked me if i could take care of the project (rewrite it in java). C# is complete garbage.
- kaba0 5y agohttps://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/java-csharpcore.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... I am as much of a Java fanboy as it gets, but football team level love-hate of languages is stupid. Also, this benchmark is not necessarily applicable to reL world programs. The CLR provides some access to low level primitives, while the JVM rather hides them. The first choice allows for more optimization by the developer, but that will be explicit and will potentially disallow some automatic ones. Java on the other hand hides most of these details and depends on a very advanced JIT compiler for most optimizations (like escape analysis), in which way even a decade old program will get magically faster. Of course it is only a crude difference between them, with Java getting primitive types, and CLR continuously improving in JIT and GC.