Optimize DefaultSynchronousMetricStorage iteration#5183
Merged
jkwatson merged 3 commits intoopen-telemetry:mainfrom Feb 22, 2023
Merged
Optimize DefaultSynchronousMetricStorage iteration#5183jkwatson merged 3 commits intoopen-telemetry:mainfrom
jkwatson merged 3 commits intoopen-telemetry:mainfrom
Conversation
Codecov ReportBase: 91.08% // Head: 91.09% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #5183 +/- ##
=========================================
Coverage 91.08% 91.09%
- Complexity 4874 4876 +2
=========================================
Files 549 549
Lines 14418 14420 +2
Branches 1372 1371 -1
=========================================
+ Hits 13133 13136 +3
+ Misses 891 890 -1
Partials 394 394
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
mateuszrzeszutek
approved these changes
Feb 8, 2023
anuraaga
reviewed
Feb 20, 2023
| List<T> points = new ArrayList<>(aggregatorHandles.size()); | ||
| for (Map.Entry<Attributes, AggregatorHandle<T, U>> entry : aggregatorHandles.entrySet()) { | ||
| T point = entry.getValue().aggregateThenMaybeReset(start, epochNanos, entry.getKey(), reset); | ||
| for (Attributes attributes : |
Contributor
There was a problem hiding this comment.
Randomly saw this PR somehow.
Just curious if .forEach would work here?
Member
Author
There was a problem hiding this comment.
Nice suggestion. This reads better and yields the same reduction in allocations.
anuraaga
approved these changes
Feb 22, 2023
Closed
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.
Reduces memory allocation required to create
Map.Entryinstances, as discussed in this comment.Performance before:
Performance after: