Performance regression for .NET 9.0 / .NET 10.0 vs. .NET 8.0
@AndyAyersMS is already working on this.
Since Sep 2, 2025.
Assessment
This issue has not been assessed yet.
Description
Description
During benchmarking, we found that there is a significant difference between the performance of our project (RavenDB) between .NET 8.0 and .NET 9.0 or .NET 10.0.
Our results:
v7.1 (.net 8.0)
[OVERALL], RunTime(ms), 50225
[OVERALL], Throughput(ops/sec), 19910.40318566451
v7.1 (.net 9.0)
[OVERALL], RunTime(ms), 99615
[OVERALL], Throughput(ops/sec), 10038.648797871807
That is close to 50%(!) regression in our tests.
We were able to reproduce a similar regression in a much smaller benchmark, where we are observing roughly 10% performance regression between 8.0 and 9.0 (10.0 is a bit better than 9.0, it is still slower than 8.0).
Repro code here: https://gist.github.com/ayende/e94d9ad6e8bba41a36d33ffb9e6de2ad
Configuration
- All tests were run on Windows
- dotnet versions tests:
> dotnet --list-sdks
8.0.413 [C:\Program Files\dotnet\sdk]
9.0.304 [C:\Program Files\dotnet\sdk]
10.0.100-preview.6.25358.103 [C:\Program Files\dotnet\sdk]
Regression?
Significant performance regression
- .NET 8.0 - 955ms - 995ms tested
- .NET 9.0 - 1103ms - 1132ms tested
Full results:
PS C:\Work\tryout> .\bin\Release\net8.0\ConsoleApp1.exe
955
PS C:\Work\tryout> .\bin\Release\net8.0\ConsoleApp1.exe
989
PS C:\Work\tryout> .\bin\Release\net8.0\ConsoleApp1.exe
995
PS C:\Work\tryout> .\bin\Release\net9.0\ConsoleApp1.exe
1103
PS C:\Work\tryout> .\bin\Release\net9.0\ConsoleApp1.exe
1119
PS C:\Work\tryout> .\bin\Release\net9.0\ConsoleApp1.exe
1132
Data
Here is the profiling output comparing those two versions.
Note: Sparrow.Json.JsonOperationContext.ReadObjectInternal(Object, String, UsageMode, IBlittableDocumentModifier)
- .NET 8.0 is 2,201 ms under profiler
- .NET 9.0 is 2,847 ms under profiler
Repro code
https://gist.github.com/ayende/e94d9ad6e8bba41a36d33ffb9e6de2ad
I run the build using dotnet build -c Release and change the <TargetFramework>net9.0</TargetFramework> in the .csproj from net8.0 to net9.0 to test the different frameworks.
@redknightlois @EgorBo
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area-System.Reflection blocking-clean-ci-optional Known Build Error os-mac-os-x untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
area-VM-meta-mono untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·