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

Lazy RUM raw event creation in event generator methods #2363

Merged

Conversation

0xnm
Copy link
Contributor

@0xnm 0xnm commented Oct 31, 2024

What does this PR do?

This PR does a bit of the optimization for the methods in RumEventExt: when random RUM raw event needs to be created, we are avoiding creating all of them and then selecting only one, but instead selecting the type and then creating only the selected one.

This gives a benefit for the tests where a lot of events are created. For example, for the RumViewScopeTest#M produce event safe for serialization W handleEvent() where there is a 1000 iterations loop to call RumMonitor#handleEvent this change is reducing execution time from 15s to 2s (and it will be much less redundant objects created, less work for GC).

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@0xnm 0xnm requested review from a team as code owners October 31, 2024 09:59
@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.36%. Comparing base (a1b97be) to head (0b9e2ac).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2363      +/-   ##
===========================================
+ Coverage    70.26%   70.36%   +0.10%     
===========================================
  Files          743      743              
  Lines        27681    27676       -5     
  Branches      4629     4630       +1     
===========================================
+ Hits         19449    19474      +25     
+ Misses        6937     6921      -16     
+ Partials      1295     1281      -14     

see 29 files with indirect coverage changes

@0xnm 0xnm merged commit 51ab074 into develop Oct 31, 2024
24 checks passed
@0xnm 0xnm deleted the nogorodnikov/lazy-rum-event-creation-in-event-generators branch October 31, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants