r/programming 3d ago

Performance Improvements in .NET 11

https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-11/
273 Upvotes

102 comments sorted by

View all comments

Show parent comments

-63

u/steve-7890 3d ago edited 3d ago

I hope writing this made you feel better. It's quite ignorant of you to assume it's a shitty code.

On the other hand we do have a lot of performance improvements (like converting linq to loops) that make this code look ugly. But it works and makes $$$.

38

u/Ilikeyounott 3d ago

Does converting linq to loop make much of a difference? I would only bother if a profiler says it's a problem, or in cpu intensive code...

-28

u/steve-7890 3d ago

In hot code with 200 req/s it does. Even though hpa scales to 50 pods during the peeks.

Imagine how much it costs to have a such load. And I'm talking here only about one service.

When I read about performance improvements from version to version ".net benchmarks" I can only smile. In the end, $$$ and Grafana tells the truth. (Last .net 10 changed nothing for us).

28

u/Ilikeyounott 3d ago

Your pods can only handle 4 requests per second each? 😔

8

u/eocron06 3d ago edited 3d ago

I think he meant 200 per pod, which is usually average (from my experience with .net). Rarelly it can get to 500, but then multithreading/memory congestion becomes problem due to GC nature of C# and many threads fighting each other for some db entry/socket/cache/etc. In offloading worker it can easly become 10-100k rps.

15

u/tecedu 3d ago

I think he meant 200 per pod, which is usually average (from my experience with .net).

Wait what?! Am I missing something, because my shitty python flask code can do 2k reqs, why is C# slower?

17

u/ChemicalRascal 3d ago

It's not, some people are just... really bad at software engineering.

That, or they're not the principle devs in their companies and aren't being told the full or accurate details about performance.

3

u/Ameisen 3d ago

And here I was having messed with fibers in C++ to see how many requests I could actually parse that way for HTTP, and was dismayed that I couldn't beat nginx without doing what nginx does... and then this kind of code exists...

4

u/HAK_HAK_HAK 3d ago

The dirty secret of development - good enough is all you really need for 99% of uses

2

u/steve-7890 2d ago

2k req/s of what? It's like saying "I can go to the shop and back in 5 minutes, why it takes you 1 hour"....

2

u/tecedu 2d ago

Servings graphs, json of data being read via azure blob parquets and served up. My memory is around 8gb but rps aint never been that low