[WIP] Performance improvements#7071
Draft
martincostello wants to merge 1 commit intoopen-telemetry:mainfrom
Draft
[WIP] Performance improvements#7071martincostello wants to merge 1 commit intoopen-telemetry:mainfrom
martincostello wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
Apply some performance improvements suggested by Copilot after prompting it to look for quick wins.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7071 +/- ##
==========================================
- Coverage 88.54% 88.54% -0.01%
==========================================
Files 270 270
Lines 12884 12935 +51
==========================================
+ Hits 11408 11453 +45
- Misses 1476 1482 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
martincostello
commented
Apr 13, 2026
| } | ||
|
|
||
| throw new InvalidOperationException($"Multiple {name} headers."); | ||
| #else |
Member
Author
There was a problem hiding this comment.
Should compare the numbers for net462, because the code looks identical, but there's probably a reason it differs other than just where the TryGet() is getting values from.
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 free
to 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.
Changes
Apply some performance improvements suggested by Copilot after prompting it to look for quick wins.
For now these are just for review to see what people think - some of the improvements seem like gains, but some of the others might be trying to get gains at the expense of functional correctness.
For any changes that seem correct and worth taking, I can split them out into separate PRs as the files touch 3 different projects.
For any changes that didn't seem to be covered by existing benchmarks, new benchmarks have been added.
Benchmark results
Copilot Summary
Benchmarks.Context.BaggageBenchmarksBenchmarks.Context.Propagation.BaggagePropagatorBenchmarksBenchmarks.Context.Propagation.TraceContextPropagatorBenchmarksBenchmarks.Exporter.OtlpMetricExporterBenchmarksBenchmarks.Metrics.HistogramAdviceBenchmarksExpand to see
main+ the new benchmarksBaggageBenchmarks
BaggagePropagatorBenchmarks
TraceContextPropagatorBenchmarks
OtlpMetricExporterBenchmarks
HistogramAdviceBenchmarks
This PR
BaggageBenchmarks
BaggagePropagatorBenchmarks
TraceContextPropagatorBenchmarks
OtlpMetricExporterBenchmarks
HistogramAdviceBenchmarks
Merge requirement checklist
Unit tests added/updatedAppropriateCHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)