Performance | Improve performance of driver by continuously cleaning up ActivityIDs stored in internal Map#1020
Merged
peterbae merged 24 commits intomicrosoft:devfrom Apr 9, 2019
Merged
Conversation
David-Engel
reviewed
Apr 4, 2019
Collaborator
|
I like the additional change to not populate the map at all if tracing is off. Other than one optional check in my comment, looks good to me. |
Codecov Report
@@ Coverage Diff @@
## dev #1020 +/- ##
============================================
+ Coverage 50.13% 50.49% +0.36%
- Complexity 2882 2938 +56
============================================
Files 120 120
Lines 27989 27999 +10
Branches 4677 4685 +8
============================================
+ Hits 14032 14139 +107
- Misses 11699 11709 +10
+ Partials 2258 2151 -107
Continue to review full report at Codecov.
|
Contributor
Author
|
Attaching the latest jars (zip file contains both JRE8/11 versions) for testing: |
rene-ye
reviewed
Apr 8, 2019
rene-ye
reviewed
Apr 8, 2019
cheenamalhotra
previously approved these changes
Apr 9, 2019
rene-ye
previously approved these changes
Apr 9, 2019
lilgreenbird
reviewed
Apr 9, 2019
lilgreenbird
previously approved these changes
Apr 9, 2019
a0e37aa
rene-ye
approved these changes
Apr 9, 2019
ulvii
approved these changes
Apr 9, 2019
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.
Replaces PR #1018.
Every time
ActivityCorrelator::cleanupActivityIdis called, the driver now iterates through the Activity ID map and removes entries that are no longer needed.To alleviate this change from affecting the driver's performance, I've made changes during the pre-login process to not create an ActivityID if Activity Trace is not on (before, the driver was creating an ActivityID during pre-login regardless of the Activity Trace being on or not), because Activity ID is an optional part of the pre-login header. This means that the Activity ID map will be empty if Activity Trace is turned off, as opposed to before where the Activity ID map was getting populated regardless.
I've also added tests to show that the Activity ID map is no longer leaking memory.