Repository navigation
Closed
Labels
arch-x64area-System.Linqos-windowsruntime-coreclrspecific to the CoreCLR runtimetenet-performancePerformance related issuetenet-performance-benchmarksIssue from performance benchmark
Milestone
Description
Run Information
| Name | Value |
|---|---|
| Architecture | x64 |
| OS | Windows 10.0.22631 |
| Queue | ViperWindows |
| Baseline | 46b72c7c81592b429e062bacebe8d39f17362333 |
| Compare | cd27dcec16016aa54be6a09962d1b509150cf99b |
| Diff | Diff |
| Configs | CompilationMode:tiered, RunKind:micro |
Regressions in System.Linq.Tests.Perf_Enumerable
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio |
|---|---|---|---|---|---|---|---|---|
| 45.36 ns | 106.98 ns | 2.36 | 0.13 | False | ||||
| 58.00 ns | 101.21 ns | 1.75 | 0.15 | False | ||||
| 32.01 ns | 53.97 ns | 1.69 | 0.09 | False | ||||
| 33.02 ns | 55.42 ns | 1.68 | 0.11 | False | ||||
| 40.67 ns | 62.28 ns | 1.53 | 0.03 | False | ||||
| 30.72 ns | 45.35 ns | 1.48 | 0.06 | False |
Repro
General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Linq.Tests.Perf_Enumerable*'Details
System.Linq.Tests.Perf_Enumerable.Max(input: IEnumerable)
ETL Files
Histogram
JIT Disasms
System.Linq.Tests.Perf_Enumerable.Min(input: IEnumerable)
ETL Files
Histogram
JIT Disasms
System.Linq.Tests.Perf_Enumerable.FirstWithPredicate_LastElementMatches(input: IEnumerable)
ETL Files
Histogram
JIT Disasms
System.Linq.Tests.Perf_Enumerable.AnyWithPredicate_LastElementMatches(input: IEnumerable)
ETL Files
Histogram
JIT Disasms
System.Linq.Tests.Perf_Enumerable.WhereAny_LastElementMatches(input: IEnumerable)
ETL Files
Histogram
JIT Disasms
System.Linq.Tests.Perf_Enumerable.All_AllElementsMatch(input: IEnumerable)
ETL Files
Histogram
JIT Disasms
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
Run Information
| Name | Value |
|---|---|
| Architecture | x64 |
| OS | Windows 10.0.22631 |
| Queue | ViperWindows |
| Baseline | 46b72c7c81592b429e062bacebe8d39f17362333 |
| Compare | cd27dcec16016aa54be6a09962d1b509150cf99b |
| Diff | Diff |
| Configs | CompilationMode:tiered, RunKind:micro |
Regressions in System.Linq.Tests.Perf_ImmutableArrayExtensions
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio |
|---|---|---|---|---|---|---|---|---|
| 47.18 ns | 59.25 ns | 1.26 | 0.22 | False |
Repro
General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Linq.Tests.Perf_ImmutableArrayExtensions*'Details
System.Linq.Tests.Perf_ImmutableArrayExtensions.SequenceEqual(input: ICollection)
ETL Files
Histogram
JIT Disasms
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
Metadata
Metadata
Assignees
Labels
arch-x64area-System.Linqos-windowsruntime-coreclrspecific to the CoreCLR runtimetenet-performancePerformance related issuetenet-performance-benchmarksIssue from performance benchmark







Activity
LoopedBard3 commentedon Jun 30, 2026
🔍 Automated Triage Analysis
Summary: Verified regression in Max(input: IEnumerable) — caused by commit 414b194 ("Add MemoryExtensions.Min/Max (#128306)"). 2 tests bisected to related culprit commits.⚠️ Note: Historical data shows bimodal behavior — bisection result may be unreliable.
Finding Confidence: 3/5 (analysis accuracy)
Regression Confidence: 3/5 (likelihood of true regression)
Likely Cause: 414b194d3a5a6c133cd19edaad73232e29c2e3fd
🤖 Proposed Next Actions: Uncertain — flag for re-triage — 1 done, 1 dry-run (rule
R5_look_again— see Full Analysis for the table). · 🦆 Re-analysis: ✅ concurs📊 Full Analysis (click to expand)
Summary: 2 confirmed regressions in System.Linq Max (+136%) and Min (+75%) attributed to commit 414b194 ("Add MemoryExtensions.Min/Max"), which refactored LINQ Min/Max to delegate to new MemoryExtensions APIs. Finding confidence 4/5 (strong historical data, 300 runs), regression confidence 4/5 (direct code path change, step change with z=3.8/3.0). 1 additional regression (WhereAny +53%) and 4 borderline tests show bimodal historical behavior making attribution uncertain.
Issue Overview
Test Analysis
Legend: μ=mean, σ=stddev, n=runs, z=z-score, Thresh%=adaptive threshold
Finding Confidence: 4/5 - Strong historical data (300 runs per test), sufficient after-runs (34), but bimodal before-series inflates CV and complicates thresholds for 5 of 7 tests.
Candidate Stack Relevance
src/libraries/System.Linq/src/System/Linq/Max.cs,Min.cs,MaxMin.cs(removed),src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.MinMax.cs(added)src/libraries/System.Linq.Expressions/...src/libraries/System.Private.Xml.Linq/...src/libraries/System.Text.Json/...Confirmed Regressions
System.Linq.Tests.Perf_Enumerable.Max(input: IEnumerable) (+135.8%)
Maximplementation by removing the sharedMaxMin.cshelper (170 lines deleted) and modifyingMax.cs(+7 -26 lines) to delegate to newMemoryExtensions.MinMax.csAPIs (+351 lines). The new code path through MemoryExtensions likely introduces overhead for IEnumerable inputs that are not Span-backed, as the MemoryExtensions path may involve additional type-checking, interface dispatch, or boxing. The timing aligns perfectly with the regression date (2026-06-24).System.Linq.Tests.Perf_Enumerable.Min(input: IEnumerable) (+74.5%)
Min.csmodified identically toMax.csin the same commit.Min.csidentically toMax.cs(+7 -26 lines), redirecting through the new MemoryExtensions path. Both Min and Max show the same pattern — step change to values exceeding all prior history — strongly corroborating shared root cause.System.Linq.Tests.Perf_Enumerable.WhereAny_LastElementMatches(input: IEnumerable) (+53.1%)
Borderline Tests
System.Linq.Tests.Perf_Enumerable.FirstWithPredicate_LastElementMatches (+68.6%)
System.Linq.Tests.Perf_Enumerable.AnyWithPredicate_LastElementMatches (+67.8%)
System.Linq.Tests.Perf_Enumerable.All_AllElementsMatch (+47.6%)
System.Linq.Tests.Perf_ImmutableArrayExtensions.SequenceEqual (+25.6%)
Open Questions
Recommended Actions
RunWithBuildAtHashon commit 414b194d3a5a vs baseline 46b72c7c8159 using Max and Min tests to confirm the regression.MemoryExtensions.MinMax.csimplementation for IEnumerable fallback paths — the overhead likely comes from additional interface dispatch, type-checking, or boxing when the input is not Span-backed.collectHardwareCounters=true) on the Max test at baseline vs compare to identify whether the regression is from branch mispredictions, cache misses, or instruction count growth.Bisection Results
Total bisection time: 18071s
Success rate: 2/7 tests
System.Linq.Tests.Perf_Enumerable.Max(input: IEnumerable)
System.Linq.Max.csandSystem.Linq.Min.cs, removing shared code fromMaxMin.csand refactoring the Min/Max implementations to delegate to newMemoryExtensions.Min/Maxmethods. The regressing testPerf_Enumerable.Max(input: IEnumerable)exercises exactly theEnumerable.Maxcode path that was changed. The regression is a plausible consequence of the refactoring altering the hot path for IEnumerable inputs.Helix jobs
fe49d6f1-e162-41fe-98ec-9bd0db9932cdac7936f0-4f70-4467-94eb-e167bef00a1ea29dac81-4ce4-445f-a387-89666eaaea06Per-commit measurements
414b194d3a5ab06f62fc8e16ce71db3201f6bf3fa3f2822fBisection details
…[earlier output omitted]
Both runs are consistent. The regression is clearly introduced at commit 414b194.
Summary of all measurements:
System.Linq.Tests.Perf_Enumerable.Min(input: IEnumerable)
System.Linq/src/System/Linq/Min.csandMaxMin.cs, refactoring the Min/Max implementations to delegate to new MemoryExtensions.Min/Max helpers. This is the exact code path exercised by theSystem.Linq.Tests.Perf_Enumerable.Minbenchmark. The regression is a direct consequence of the changed implementation.Helix jobs
91c87de1-3f70-41d6-aeec-456fb5369c5cbdab49e9-1b9d-4bb3-88aa-37533973e19ePer-commit measurements
414b194d3a5ab06f62fc8e16bf3fa3f2822fce71db3201f6Bisection details
…[earlier output omitted]
The regression is between bf3fa3f and 414b194. Commit 414b194 is the culprit. Let me examine it.
● get_single_commit_summary (MCP: PerfTriageMcp) · owner: "dotnet", repo: "runtime", sha: "414b194d…
└ {"index":null,"sha":"414b194d3a5a6c133cd19edaad73232e29c2e3fd","abbrevSha":"4...
This is a perfect match. The commit "Add MemoryExtensions.Min/Max (#128306)" directly modifies
System.Linq/src/System/Linq/Min.cs— the exact code path exercised by theSystem.Linq.Tests.Perf_Enumerable.Minbenchmark. The delta (57→101 ns, +77%) is well above the 2σ noise floor (23.7 ns) and matches the reported regression magnitude (+74.5%).System.Linq.Tests.Perf_Enumerable.FirstWithPredicate_LastElementMatches(input: IEnumerable)
Helix jobs
fa57e988-b315-4c8b-b0cf-1ba452d4e0d0900029ec-4f20-49ce-bc62-97ce81709f9689ea6224-b0be-4ad5-a655-b3b4da88cdb36b42a79c-c049-491f-a8de-c91efe8a96b4Per-commit measurements
46b72c7c8159414b194d3a5ace71db3201f605cecc17cc17bf62aa30c9f4cd27dcec1601Bisection details
…[earlier output omitted]
821321498-copi...
● Parse boundary test results (shell)
│ cat /tmp/1782821321498-copilot-tool-output-zfloy1.txt | python3 -c "
│ import json, sys, re
│ data = json.load(sys.stdin)
│ report = json.loads(data['report'])
│ benchmarks = report.get('Benchmarks', [])…
└ 12 lines…
Both boundary commits show identical performance (~31 ns). The reported regression (32→54 ns) is not reproducible. All 7 commits tested across the range show ~30.8-31.4 ns.
Summary of all measurements:
46b72c7c(baseline): 30.97 ns414b194d: 31.19 ns05cecc17: 30.76 nsbf62aa30: 31.40 nsce71db3: 30.89 nscd27dcec(head): 30.84 nsNo step change anywhere. The 2σ noise floor (23.43 ns / 73.2% of baseline) exceeds the reported regression delta (22 ns / 68.6%), confirming this is noise.
HELIX JOBS:
MEASUREMENTS:
System.Linq.Tests.Perf_Enumerable.AnyWithPredicate_LastElementMatches(input: IEnumerable)
Helix jobs
651f73ce-d522-41f7-b7ad-1832e01c14dca85cf32d-d3c7-4d64-9a4e-42adef7a175aPer-commit measurements
05cecc17cc174585fc41c242bf62aa30c9f4414b194d3a5ace71db3201f6cd27dcec1601Bisection details
…[earlier output omitted]
└ Output too large to read at once (78.0 KB). Saved to: /tmp/1782823768242-copi...
● Parse Q4 results (shell)
│ cat /tmp/1782823768242-copilot-tool-output-2aymku.txt | python3 -c "
│ import json, sys
│ data = json.load(sys.stdin)
│ report = json.loads(data['report'])
│ for bm in report.get('Benchmarks', []):…
└ 15 lines…
All commits including the head show ~33 ns (baseline). The regression is not reproducible. All measurements:
The reported regression delta (67.8%) is within the 2σ noise floor (69.36%), and none of 6 tested commits reproduce the ~55 ns regressed value. This is noise.
System.Linq.Tests.Perf_Enumerable.WhereAny_LastElementMatches(input: IEnumerable)
Helix jobs
d350c1e3-918d-46a7-b380-38f6106039d231bfddfd-a7a3-4dee-850e-bfdf1bd64d12Per-commit measurements
05cecc17cc174585fc41c242bf62aa30c9f4414b194d3a5acd27dcec1601ce71db3201f6Bisection details
…[earlier output omitted]
│ data = json.load(sys.stdin)
│ report = json.loads(data['report'])
│ for i, bench in enumerate(report.get('Benchmarks', [])):…
└ 14 lines…
All measurements across the entire range show values near baseline (~40.6-41.0). Even the reported regressed commit
cd27dcec1601measures 40.72, indistinguishable from baseline 40.67. No step change is observable.Let me verify by reviewing all measurements:
All ~40.7 ns. The reported regression (40.67 → 62.28, +53.1%) is not reproducible. The 2σ noise floor is 53.85% of baseline, which is comparable to the reported 53.1% regression delta, confirming this was likely a noise artifact.
System.Linq.Tests.Perf_Enumerable.All_AllElementsMatch(input: IEnumerable)
Helix jobs
94032e66-8262-4292-8469-55bee77e38214c9dc991-ebe8-4ecc-842e-a1f625ff9d473fb85779-025e-4101-9a39-c77fa48c6d9dfceb832f-a5bd-46df-813e-69b92f4b369aPer-commit measurements
440e6cba935e9e76efa2a92f37d45de0d2f84585fc41c242414b194d3a5acd27dcec1601ce71db3201f6Bisection details
…[earlier output omitted]
│ for bm in report.get('Benchmarks', []):…
└ 12 lines…
All measurements collected. Here's the complete picture:
Every commit including the reported compare commit (cd27dce) measures at baseline (~30.7 ns). The one elevated reading (ce71db3 at 36.46) is within the 2σ noise floor and bracketed by baseline-level commits. The reported regression of 45.35 ns is not reproducible.
HELIX JOBS:
MEASUREMENTS:
System.Linq.Tests.Perf_ImmutableArrayExtensions.SequenceEqual(input: ICollection)
Helix jobs
16b726ce-6519-4185-875f-b01cf42244b04baa4922-5dbc-4220-acbd-c83ef7e4d75f25e7e18a-cff4-44e3-9b5f-24ea1590c997c3fe9932-8bda-4ab5-b99e-22defc7ebeae752242f4-f8f2-4eef-812b-6832f35d7e83290c2190-2bab-4ca8-86b9-2528e095bf4544cdc43d-d2ee-4045-8959-cd1e36620719Per-commit measurements
46b72c7c8159b06f62fc8e16e3cbc00cd3e02608ba24252bbf3fa3f2822f414b194d3a5a9c1fdaea7e45ce71db3201f605cecc17cc17cd27dcec1601Bisection details
…[earlier output omitted]
HELIX JOBS:
MEASUREMENTS:
LoopedBard3 commentedon Jun 30, 2026
Max and Min were matched to PR #128306, others seem to have been incorrectly attributed to this time range when they are really likely due to #129868. FYI @MihaZupan
dotnet-policy-service commentedon Jun 30, 2026
Tagging subscribers to this area: @dotnet/area-system-linq
See info in area-owners.md if you want to be subscribed.
MihaZupan commentedon Jul 2, 2026
Real regression for
IEnumerablesthat don't take the span path.Previously we'd have an implementation specific to integers that'd compare
<, now that goes through theIComparerpath.I did try testing this case in #128306 (comment), not sure why we saw no change EgorBot/Benchmarks#208 (comment)
DrewScoggins commentedon Jul 2, 2026
Additional regressions: