Uh oh!
There was an error while loading. Please reload this page.
Reduce assertion telemetry contention - #10560
Merged
Amaury Levé (Evangelink) merged 1 commit intoAug 18, 2026
Merged
Conversation
Use atomically incremented boxed counters to avoid ConcurrentDictionary update contention while preserving best-effort drain semantics. Add concurrency, disabled-telemetry, reset, and allocation regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Optimizes assertion telemetry counters to reduce hot-path contention while preserving best-effort drain behavior.
Changes:
- Replaces dictionary value updates with boxed atomic counters.
- Adds concurrency, reset, opt-out, and allocation coverage.
Show a summary per file
| File | Description |
|---|---|
src/TestFramework/TestFramework/Internal/TelemetryCollector.cs | Implements atomic boxed counters and snapshot draining. |
test/UnitTests/TestFramework.UnitTests/TelemetryCollectorTests.cs | Covers counting, concurrency, draining, opt-out, and allocations. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
Uh oh!
There was an error while loading. Please reload this page.
Petr Pokorny (0101)
approved these changes
Aug 11, 2026
This was referenced Aug 11, 2026
Uh oh!
There was an error while loading. Please reload this page.
Amaury Levé (Evangelink)
deleted the
dev/amauryleve/reduce-assertion-telemetry-contention
branch
August 18, 2026 09:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ConcurrentDictionary.AddOrUpdatecalls with allocation-free steady-state lookup plusInterlocked.IncrementPerformance
Standalone .NET 9 Release measurements over 5,000,000 operations (median of 7, five pre-populated assertion names):
An eager
GetOrAdd(key, new StrongBox<long>())candidate was rejected because argument evaluation allocated 120 MB over the same 5,000,000 calls.Validation
net8.0Closes#10559