-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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.