Hacker News new | ask | show | jobs
by TillE 1399 days ago
C# is such a cozy language, anyone familiar with C++ or Java can instantly bang out half-decent code, and there's a ton of great features to gradually learn and use. And the performance is about as good as it gets for a language with garbage collection. Big fan.
1 comments

And ASP.Net Core is an insanely fast web framework. It beats every other major framework written in a managed language by a mile. There's no way your backend will outgrow it if your workload isn't RAM-limited.
I am in the process of moving a .Net web forms to .Net core razor pages and the performance difference is insanely noticeable.
> And ASP.Net Core is an insanely fast web framework. It beats every other major framework written in a managed language by a mile*

* In synthetic benchmarks

Would you call TechEmpower benchmarks synthetic? I think they're a pretty useful data source and indeed support the claim that the performance of .NET is rather good.

https://www.techempower.com/benchmarks/#section=data-r21

Personally I think that some of their tests are pretty close to what web applications might actually do a lot of the time (fetching the data, processing it, saving it), for example, see here: https://github.com/TechEmpower/FrameworkBenchmarks/tree/mast...

Sure, sometimes the code you see in benchmarks can be a bit more clever than the code you'd see normally, but for the most part TechEmpower seems close enough to be a vague indicator towards what frameworks/languages/stacks have decent performance.

It also helps you get a feel for how big the differences are between any two given platforms, like using something like Java + Spring and Python + Django, which may or may not be relevant in actual business conditions, since you might also want to iterate quickly.

It produces best performance OOB with minimal API way of registering your endpoints. Which is expected to be the default way for many newcomers to the framework. On 5800X, hello world with some logic and cached JSON output (not raw bytes but actual response object so no cheating) produces over 4GB/sec when benchmarked over localhost on .NET 7.

Host: https://gist.github.com/neon-sunset/767cb0693c3ff222f78b236c...

HTTP Benchmark: https://gist.github.com/neon-sunset/d936e54bfec1031d1628c338...

Ok, but how else do you compare two frameworks?

The only other real way is to write two programs that do the same thing in both. You need to put in the same degree of runtime/environment-specific optimizations (which, notably, will result in different code), but except for in trivially simple applications (eg: "TODO app") which are arguably also "synthetic", the optimizations are always going to leave room for debate.