Repository navigation
Description
Description
During migration of WPF app from .net8 to .net10 we've noticed significant degradation in cold start performance in RX-heavy workflows. I've wrote sample benchmarks with many RX subscriptions that mostly aligns with benchmark results we see in our production app.
I've tested different versions of .net10 and it looks like 10.0.0 performs better than 10.0.7 in this benchmark. Since it's cold-start benchmark, it's not very stable but I was able to get similar results on two different CPUs (AMD 7950x and AMD 7950x3D).
Benchmark sources: https://github.com/firenero/DotNetRxBench
We have also noticed ~27% slower execution of our UI tests in .net 10 but I don't have any sample solution to share.
Regression?
Yes, both .net8 and .net9 perform better in this scenario.
Data
.NET 10.0.0 + AMD 7950x3D
// * Summary *
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.8246/25H2/2025Update/HudsonValley2)
AMD Ryzen 9 7950X3D 4.20GHz, 1 CPU, 32 logical and 16 physical cores
.NET SDK 10.0.100
[Host] : .NET 8.0.26 (8.0.26, 8.0.2626.16921), X64 RyuJIT x86-64-v4
Job-AOJIKS : .NET 8.0.26 (8.0.26, 8.0.2626.16921), X64 RyuJIT x86-64-v4
Job-HBMQMI : .NET 9.0.15 (9.0.15, 9.0.1526.17522), X64 RyuJIT x86-64-v4
Job-EPQKMY : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v4
Server=False IterationCount=1 LaunchCount=50
RunStrategy=ColdStart WarmupCount=0
| Method | Runtime | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|
| ConstructAndInitialize | .NET 8.0 | 116.6 ms | 0.84 ms | 1.70 ms | 1.00 | 0.02 | 155.5 KB | 1.00 |
| ConstructAndInitialize | .NET 9.0 | 115.4 ms | 0.86 ms | 1.74 ms | 0.99 | 0.02 | 155.65 KB | 1.00 |
| ConstructAndInitialize | .NET 10.0 | 129.2 ms | 0.53 ms | 1.07 ms | 1.11 | 0.02 | 203.73 KB | 1.31 |
.NET 10.0.7 + AMD 7950x3D
// * Summary *
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.8246/25H2/2025Update/HudsonValley2)
AMD Ryzen 9 7950X3D 4.20GHz, 1 CPU, 32 logical and 16 physical cores
.NET SDK 10.0.203
[Host] : .NET 8.0.26 (8.0.26, 8.0.2626.16921), X64 RyuJIT x86-64-v4
Job-AOJIKS : .NET 8.0.26 (8.0.26, 8.0.2626.16921), X64 RyuJIT x86-64-v4
Job-HBMQMI : .NET 9.0.15 (9.0.15, 9.0.1526.17522), X64 RyuJIT x86-64-v4
Job-EPQKMY : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v4
Server=False IterationCount=1 LaunchCount=50
RunStrategy=ColdStart WarmupCount=0
| Method | Runtime | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|
| ConstructAndInitialize | .NET 8.0 | 118.5 ms | 1.28 ms | 2.58 ms | 1.00 | 0.03 | 155.5 KB | 1.00 |
| ConstructAndInitialize | .NET 9.0 | 115.7 ms | 1.01 ms | 2.03 ms | 0.98 | 0.03 | 107.6 KB | 0.69 |
| ConstructAndInitialize | .NET 10.0 | 160.3 ms | 1.27 ms | 2.56 ms | 1.35 | 0.04 | 203.73 KB | 1.31 |
.NET 10.0.7 + AMD 7950x
// * Summary *
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.8246/25H2/2025Update/HudsonValley2)
AMD Ryzen 9 7950X 4.50GHz, 1 CPU, 32 logical and 16 physical cores
.NET SDK 10.0.203
[Host] : .NET 8.0.26 (8.0.26, 8.0.2626.16921), X64 RyuJIT x86-64-v4
Job-AOJIKS : .NET 8.0.26 (8.0.26, 8.0.2626.16921), X64 RyuJIT x86-64-v4
Job-HBMQMI : .NET 9.0.15 (9.0.15, 9.0.1526.17522), X64 RyuJIT x86-64-v4
Job-EPQKMY : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v4
Server=False IterationCount=1 LaunchCount=50
RunStrategy=ColdStart WarmupCount=0
| Method | Runtime | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|
| ConstructAndInitialize | .NET 8.0 | 118.4 ms | 2.71 ms | 5.48 ms | 115.9 ms | 1.00 | 0.06 | 155.5 KB | 1.00 |
| ConstructAndInitialize | .NET 9.0 | 116.1 ms | 2.65 ms | 5.36 ms | 113.5 ms | 0.98 | 0.06 | 155.65 KB | 1.00 |
| ConstructAndInitialize | .NET 10.0 | 161.0 ms | 3.49 ms | 7.04 ms | 156.1 ms | 1.36 | 0.08 | 155.68 KB | 1.00 |
Analysis
I'm not sure if the problem is limited to System.Reactive usage but in our case it's been affected the most.
Throughput performance in .net10 is on par with .net8 and .net9 in this benchmark so I think the issue only affects cold starts.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
dotnet-policy-service commentedon May 2, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
petevb commentedon May 8, 2026
@JulieLeeMSFT, @jakobbotsch can you take a look please? This blocks us moving from .NET 8 which is EOL Nov 10.
JulieLeeMSFT commentedon May 8, 2026
@EgorBo PTAL.
petevb commentedon May 15, 2026
@EgorBo can you take a look please? This blocks us moving from .NET 8 which is EOL Nov 10.
EgorBo commentedon May 15, 2026
Sure, I'm bisecting the problem
EgorBo commentedon May 16, 2026
Note
This comment was authored with the help of GitHub Copilot CLI (run by @EgorBo).
I bisected this against every available 10.x SDK on Windows x64 (AMD 7950X) using the original BDN repro from this issue (
ViewModelInitBench.ConstructAndInitialize, BDN ColdStart, LaunchCount=50). Each run pinnedDOTNET_ROOT/PATHto one SDK so the system-wide install never participates. .NET 9.0.16 is the baseline.Cold-start results across SDKs
Where the regression happened
Most of the gap accumulated during the preview cycle (a separate investigation), but the biggest single jump is in servicing:
10.0.3 → 10.0.4: +27 ms in one release (129.7 → 156.7 ms). This single delta is bigger than any preview-cycle delta and accounts for ~60% of the total 10.0 regression vs 9.0. It is stable across 10.0.4 / 10.0.5 / 10.0.6 / 10.0.7 / 10.0.8 servicing patches, so it's clearly a code change that landed once and stuck.
The
v10.0.3..v10.0.4window has 43 commits, of which 15 touch CoreCLR; none touch the JIT.Primary suspect
#123520 "Fix regression caused by special marker type optimization" (backport of #123413), merged Jan 23 2026 to
release/10.0.This PR rewrites
MethodTableBuilder::LoadExactInterfaceMap(+113 lines) to handle correctness bugs in the earlier startup-perf optimization #120712 / #120459 ("Reduce types loaded on startup significantly", claimed "reduces startup time of small applications by as much as 20%", shipped in 10.0.3). #123520's own PR description acknowledges this:The fix is more conservative than necessary for our workload:
retry = truepath causesLoadExactInterfaceMapto re-run with exact instantiations whenever the special-marker fast path can't be safely used.EligibleForSpecialMarkerTypeUsagecheck falls through to loading the exact uninstantiated interface MT when generic args differ — which is exactly the shape of every Rx subscription in this repro (IObservable<ValueTuple<Bool, Int32, String, …>>,IObserver<…>with mixed type args).This matches the ETW profile I captured (
MethodTableBuilder::BuildMethodTableThrowing,ClassLoader::LoadTypeHandleForTypeKey, andMethodTable::MethodDataObject::FillEntryDataForAncestorall became significantly hotter in 10.0.4+).Secondary suspect (smaller contribution)
#124110 "Fix token memory ordering issue reading from the MethodDef and FieldDef token tables" (backport of #123557), merged Feb 10 2026.
Replaces
VolatileLoadWithoutBarrier→VolatileLoadinLookupMap::GetValueAt, called on every token→MethodDesc/FieldDesc/MethodTable lookup. The PR author explicitly flagged: "Low, the largest risk is a small performance regression." Likely accounts for a few ms of the 27.EgorBo commentedon May 16, 2026
cc @davidwrighton @jkotas
Moving to VM area since there were no JIT changes between 10.0.3 and 10.0.4 runtimes (biggest offender)
dotnet-policy-service commentedon May 16, 2026
Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.
EgorBo commentedon May 16, 2026
Note
AI-assisted (GitHub Copilot CLI, run by @EgorBo).
Brief follow-up on the preview.1 → preview.2 step (+11 ms) — likely suspects in that window:
prestub.cpp,precode.cpp,method.hpp)EgorBo commentedon May 16, 2026
Actually, it can also be #123615 after a precise bisection.. (copilot claims it's native PGO)
[release/10.0] Downgrade dotnet-optimization dependencies to LKG (#12…
firenero commentedon May 27, 2026
@EgorBo @JulieLeeMSFT thanks for investigating the issue. I see a couple related PRs merged but it's not clear when we can expect it to be released? Looks like these fixes will be included in 10.0.10 but milestone for this ticket is set to 11.0.0. Also, if it's 10.0.10, is there an estimated release date for that version?
EgorBo commentedon Jun 2, 2026
I am not entirely sure it will be fully mitigated by #128345 but I suspect it should be in June's patch, need to check the exact date.