News for hackers. Stuff that matters.
Re:Emulating Nintendo Switch Games on Linux by banachtarski on Friday July 24, 2020 @03:11PM (#23943356)
C# is consistently a worse performer than most javascript runtimes currently, and it's not much better than Python, Ruby, and PHP.

It's not just that. Basic patterns in C# are known to have pathological performance problems (implicit boxing, implicit heap allocations) that you simply don't run into programming in C or C++. These are things that tank performance in day-to-day programming that do not show up in carefully tuned benchmarks.

Source: Helped profile lots of C# games (not IL2CPP with Unity, although that's pretty bad IMO as well), not pleased with what I saw.

Re:Emulating Nintendo Switch Games on Linux by askingforproof on Friday July 24, 2020 @05:29PM (#23944671)
> C# is consistently a worse performer than most javascript runtimes currently

This is a bold claim. Please provide evidence that the most current .NET implementation (.NET Core 3.1) is slower than any JavaScript implementation.

This doesn't pass the smell test since you're comparing an ahead-of-time statically typed approach to a dynamic scripting language, both of which have had highly tuned JIT implementations, both of which are using garbage collection. You can implement things poorly in C#, sure, but you're making a much stronger claim of consistently poor performance.

Saying 'dude trust me' is not a source.

Re:Emulating Nintendo Switch Games on Linux by hu3 on Saturday July 25, 2020 @01:24AM (#23947046)
Agreed. Take a look at https://www.techempower.com/benchmarks/#section=data-r19&hw=...

C# currently 1st place in this webserver benchmark. Ahead of C/C++/Go/Java/D.

No offense to JavaScript, I like it and it has its uses. But surely your OP is joking when saying JavaScript is faster than C#. Even after all the performance improvements that V8 received.

Re:Emulating Nintendo Switch Games on Linux by asveikau on Friday July 24, 2020 @07:18PM (#23945470)
At least C# has things like the struct keyword to prevent heap allocations for simple data structures. I don't know if recent Java has caught up with this, but it was one of the innovative features MS came up with for .NET to avoid unnecessary overhead.

I feel like it's possible to write careful C# for performance. It just won't be entirely idiomatic. Things like buffer re-use, ordinary techniques you'd need to apply manually for C and C++ in similar domains too.

Re:Emulating Nintendo Switch Games on Linux by to11mtm on Saturday July 25, 2020 @11:09AM (#23949744)
A large part of C#'s advancements are that additional abstractions have been added in .NET Core to make at least some of those concepts a bit more idiomatic, especially around passing segments of memory around.