Skip to content
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

⚡️ [RUM-2917] optimize getNodePrivacyLevel by adding a cache #2579

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

BenoitZugmeyer
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer commented Jan 26, 2024

Motivation

A customer reported that getNodePrivacyLevel was a big performance bottleneck on their application when the devtools were open. On our side, we didn't observe a huge performance impact caused by this function (with or without devtools open), but still find a way to optimize it, which might help the customer case.

Changes

Cache the node privacy level when processing mutations. The cache is local to the proccessMutations function so we don't have to implement a complex way to invalidate it. Even with this simple cache, we observed a nice speedup while processing mutations (from ~10ms to ~1.5ms in a specific case on the Datadog App)

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@BenoitZugmeyer BenoitZugmeyer requested review from a team as code owners January 26, 2024 17:20
@BenoitZugmeyer BenoitZugmeyer changed the title ⚡️ [RUM-2893] optimize getNodePrivacyLevel by adding a cache ⚡️ [RUM-2917] optimize getNodePrivacyLevel by adding a cache Jan 26, 2024
Copy link
Contributor

@N-Boutaib N-Boutaib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✔️

Copy link
Contributor

@bcaudan bcaudan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@BenoitZugmeyer
Copy link
Member Author

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Jan 29, 2024

🚂 Branch Integration: starting soon, merge in < 0s

Commit f144a6f7a9 will soon be integrated into staging-05.

This build is going to start soon! (estimated merge in less than 0s)

Use /to-staging -c to cancel this operation!

dd-mergequeue bot added a commit that referenced this pull request Jan 29, 2024
@dd-devflow
Copy link

dd-devflow bot commented Jan 29, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit f144a6f7a9 has been merged into staging-05 in merge commit cf710c7d9f.

Check out the triggered pipeline on Gitlab 🦊

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c238972) 92.82% compared to head (bcafc7a) 92.83%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2579   +/-   ##
=======================================
  Coverage   92.82%   92.83%           
=======================================
  Files         232      232           
  Lines        6760     6768    +8     
  Branches     1486     1489    +3     
=======================================
+ Hits         6275     6283    +8     
  Misses        485      485           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BenoitZugmeyer BenoitZugmeyer merged commit 39cf938 into main Feb 1, 2024
17 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/optimize-get-node-privacy-level branch February 1, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants