dotnet / dotnet/aspnetcore

Performance degradation on upgrade from .NET 8 to .NET 9/10 with concurrent requests

Open
#64,711 17 comments 2 reactions 0 assignees View on GitHub
area-networking feature-kestrel
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Description

When doing concurrent requests after the API has started, the response times increase significantly compared to older .NET versions. On our front-end we are doing some initial calls with some of the calls being sequential, and some blocks of concurrent calls. Overall, the response time is 6-8 times slower. If the calls are all executed in sequence, there are no performance issues.

Performance issues only occur when running from Visual Studio (26) with the Diagnostic tools enabled. When running without a debugger (Ctrl + f5 or the performance analyzer) the issue is not noticeable.

You can clone my minimal example from here: https://github.com/leondeklerkfenetre/dotnet-performance-degradation
The README contains steps on how to run

### Configuration

.NET 10.0.100
Windows 11 Business 26200.7171
x64
Visual Studio 26

### Regression?

The performance is good on .NET 6/7/8 but degrades on .NET 9/10 (10 improves slightly over 9)

### Data

| Version | Avg Response |
| ------- | ------------ |
| .NET 8 | 49ms |
| .NET 9 | 437ms |
| .NET 10 | 340ms |

### Analysis

The only pointer I can give is that the issue is mostly noticeable with the diagnostic tools and debugger enabled. When using the performance analyzer or after creating a release build. Also, the performance on .NET 6/7/8 is nearly identical.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.