Improve updateFeatureContext performances#2489
Merged
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2489 +/- ##
===========================================
+ Coverage 69.88% 69.94% +0.06%
===========================================
Files 788 788
Lines 29647 29646 -1
Branches 4961 4962 +1
===========================================
+ Hits 20717 20735 +18
+ Misses 7548 7535 -13
+ Partials 1382 1376 -6
|
0xnm
approved these changes
Jan 21, 2025
| - "kotlin.collections.MutableList.toTypedArray()" | ||
| - "kotlin.collections.MutableList.withIndex()" | ||
| - "kotlin.collections.MutableList.firstOrNull()" | ||
| - "kotlin.collections.MutableMap.asSequence()" |
Member
There was a problem hiding this comment.
it seems there is no usage of this method in the PR?
jonathanmos
approved these changes
Jan 21, 2025
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.
What does this PR do?
It slightly improve the performance of context sharing across modules.
Motivation
Context sharing is what allows different modules (RUM, SR, APM) to share context (e.g.: RUM Session Id) to link events together.
Additional Notes
We focused this PR on several bottlenecks.
getFeatureContext()method returned a copy of the source-of-truth Map, which was unnecessary as it was already typed as immutable;updateFeatureContext()method would create a copy of the source-of-truth map for every module it notified;updateFeatureContext()method would use the.filter{}utility on a map, which creates an unnecessary copy