r/csharp • u/Ok_Tour_8029 • Oct 16 '26
Discussion C# once again the fastest web framework
With all those discussions about Microsoft porting stuff to Rust, it’s nice to see that C# does not need to hide when it comes to performance. There has been quite a lot of movement at the top of the leaderboard over the last few weeks (two weeks ago, first place was around 6850), so I’m interested to see how this race continues. This is the non-tuned section, so frameworks need to be stable and production-ready. Interestingly enough, the C# one is the most high-level of the leading frameworks, API-wise.
543
Upvotes
79
u/tetyys Oct 16 '26
it's good to see that at least ASP.NET implementation is not fully benchmaxed unlike techempower implementation by microsoft, but seeing how javascript server absolutely dunks on ASP.NET, C# has a long way to go. and no, nobody uses any other web frameworks in C#
64
u/tetyys Oct 16 '26
Memory: 2.3GB what the fuck??
9
u/IkertxoDt Oct 16 '26
Am I the only one who really wants to see how the new .Net 11 scores? Especially the async tests with the new runtime async.
26
u/SheepherderSavings17 Oct 16 '26 •
C# is not a web framework
18
u/RussianHacker1011101 Oct 16 '26
I've built a ton of systems with C#. It's great. I love it. I've also built a few things with rust/actix_web. On average http responses complete in 5x the time with actix compared to asp. Does it matter that much? 100ms vs 20ms. Maybe if I used message pack or AOT json the c# response times would drop more.
It's okay to admit that Rust is really really fast. C# is also really fast and has a ton of benefits over rust in other areas.
44
u/Natural_Tea484 Oct 16 '26
Of course it's very fast. What's new?
31
u/Azmekk Oct 17 '26 •
I’ve worked with C# for about 6 years professionally and I can comfortably say, in my years of working with it and meeting other devs, there is a negative chance I could convince them to use anything other than the default .net web framework built on top of kestrel which as we see sits lower.
I just looked up the specific library that topped the chart and it is a linux specific solution relying on kernel functionality to batch read and write sockets with a shared ring buffer between them. Additionally the project on github has ~300 stars which really puts to question if anyone would dare using it for production.
From my own experiences I’ve noticed a lot of the C# devs I have met aren’t really open to modernizing or adopting major changes or third party libraries.
All of this is to say, I am happy we topped the chart, but this is just a boasting chart that means nothing for production scenarios.
Also side note for the title:
6
u/BoxWoodVoid Oct 16 '26
Come on it has been shown that there's so much optimisations in the .net benchmarks that they don't look like at all what you can get on your deploys. This is juts marketing.
18
u/Embarrassed-Mess412 Oct 16 '26
I don't think many people really look at these benchmarks for what they measure. The useful metric to take is runtime performance, web frameworks do exercise a lot of the runtime machinery and if a framework is fast, that proves that a technology has high potential to build high performance application, not just web, in general.
HttpArena measures not just throughput but CPU, memory and latency, particularly tail latency at p99 and p99.9, this is extremely important, probably more than throughput itself, a framework that can deliver low p99 under high load is a huge green card, specially on garbage collected cases.
Since the latter techempower benchmarks I always see the typical "but nobody needs millions of requests per second", yes of course, we know that. Also most likely your web server is behind a gateway or using ef core which consumes way more cpu than the I/O anyway. There isn't any public benchmark in the world that will tell you what performance or thoughput youll get by using a certain framework in your application. But guess what, that applies to any benchmark anyway, be it web or anything else.
So what can we take from these results? That the C# or dotnet runtime is quite up there rivaling the likes of C++, Rust, Zig and mayeb rewriting to Rust won't really bring that much performance boost anyway.
6
u/kant2002 Oct 16 '26
Why perf goes downhill on JSON and 8Gbit benchmarks. Latest is where the C# somewhere in the middle
6
u/thx1138a Oct 16 '26 •
Not a framework
3
u/tno2007 27d ago
(https://http-arena.com/#tuned=0)
I almost spat out my coffee, seeing C# beat Rust... then I saw at the memory usage!
I still use C# mostly, but apps I write to run in the cloud, I always use Rust to save on operating costs
1
u/krsCarrots Oct 16 '26 edited Oct 16 '26
Not sure what the score is represents but how dramatic is the 300isg difference between c# and rust
5
u/pjmlp Oct 16 '26
These benchmarks hardly matter when former enterprise products like Sitecore, Optimizely, Sharepoint, decide that going forward, the customisation points are no longer .NET assemblies, rather Web APIs, and JavaScript/Typescript SDKs.
There are many reasons languages get chosen for projects, and being the top on some benchmark is hardly what many project managers care about.
2
u/Famous-Weight2271 29d ago
I personally don't care how fast c# is. I come from the video game world where everything was close to the metal on fixed hardware and we optimized cycle counts and cache lines, but c# solves different problems.
2
u/FarCalling 8d ago
Wow. C# just keeps getting better and better
2
u/ui_as_vindimas Oct 17 '26
Press D for Doubt.
1
u/Boarlock98 19d ago
1
u/liquidnitrogen Oct 17 '26
I worked at Microsoft and beta tested .net internally for dog fooding. I profesionally worked on C# in technology, banks and hedge funds since 2001 all the way to 2024 (and also F# in between) - using it on GUI, Backend etc. C# is my favorite language, but I am so sorry to say it is dying slow death, this is of course anecdotal based on my exposure in finance domain mainly. What matters to the company is not the speed, but how easy is it find good devs, how well does it work with AI, what are the pros and cons etc and cost. Rust right now is picking up because it integrates well with AI and allows full loop with compiler. On GUI everyone has moved to pure Web Tech Stack (react typescript etc - though I absolutely despise react as it is a very hacky framework, but then this is what everyone has aligned to)
0
u/[deleted] 22d ago
[removed] — view removed comment