-
Notifications
You must be signed in to change notification settings - Fork 772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metrics Perf Improvement- Use KeyValuePair<string, object>[] to store dimensions #4059
Merged
utpilla
merged 11 commits into
open-telemetry:main
from
utpilla:utpilla/Update-AggregatorStore
Jan 7, 2023
Merged
Metrics Perf Improvement- Use KeyValuePair<string, object>[] to store dimensions #4059
utpilla
merged 11 commits into
open-telemetry:main
from
utpilla:utpilla/Update-AggregatorStore
Jan 7, 2023
Conversation
This file contains 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
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4059 +/- ##
==========================================
+ Coverage 85.54% 85.60% +0.05%
==========================================
Files 289 289
Lines 11259 11226 -33
==========================================
- Hits 9632 9610 -22
+ Misses 1627 1616 -11
|
alanwest
approved these changes
Jan 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
CodeBlanch
reviewed
Jan 6, 2023
CodeBlanch
reviewed
Jan 6, 2023
CodeBlanch
reviewed
Jan 6, 2023
CodeBlanch
approved these changes
Jan 6, 2023
…tpilla/opentelemetry-dotnet into utpilla/Update-AggregatorStore
…tpilla/opentelemetry-dotnet into utpilla/Update-AggregatorStore
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.
On the metrics hot path, for every update call, we copy the metric dimensions received from the DiagnosticSource callback to find the right MetricPoint to be updated. This PR updates the internal structure used to store dimensions from a combination of
string[]
andobject[]
toKeyValuePair<string, object>[]
.From the benchmark results, it looks like it takes lesser time to copy
KeyValuePair<string, object>[]
than copying bothstring[]
andobject[]
. The perf benefit becomes more visible with higher number of dimensions.Benchmark results
There is a considerable perf improvement across the board, with the perf improvement for seven dimensions (cumulative) going up to ~18%: an improvement of 60ns
BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.963)
Intel Core i7-9700 CPU 3.00GHz, 1 CPU, 8 logical and 8 physical cores
.NET SDK=7.0.101
[Host] : .NET 7.0.1 (7.0.122.56804), X64 RyuJIT AVX2
DefaultJob : .NET 7.0.1 (7.0.122.56804), X64 RyuJIT AVX2
main branch
With this PR
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes