News for hackers. Stuff that matters.
Re:Java for Everything (2014) by kaba0 on Monday April 26, 2021 @04:06PM (#26947377)
C# 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.

Re:Java for Everything (2014) by mtmmtm on Monday April 26, 2021 @05:06PM (#26948135)
You 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.
Re:Java for Everything (2014) by kaba0 on Monday April 26, 2021 @05:43PM (#26948575)
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.

Re:Java for Everything (2014) by igouy on Tuesday April 27, 2021 @11:48AM (#26957554)
> 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.

Re:Java for Everything (2014) by kaba0 on Tuesday April 27, 2021 @01:51PM (#26959176)
I 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.
Re:Java for Everything (2014) by igouy on Tuesday April 27, 2021 @03:57PM (#26960711)
I doubt that your allegation of dishonesty is welcome in this forum.

https://news.ycombinator.com/newsguidelines.html

Re:Java for Everything (2014) by kaba0 on Wednesday April 28, 2021 @02:27AM (#26966334)
What 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.

Re:Java for Everything (2014) by igouy on Wednesday April 28, 2021 @02:36PM (#26972570)
> I put cheating into quotes

That only works when you make little quoting gestures with your fingers.

Re:Java for Everything (2014) by kaba0 on Wednesday April 28, 2021 @07:00PM (#26975330)
Then feel free to read them visualizing me doing just that