-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat(replay): Filter out style
mutations when extracting DOM nodes
#83016
feat(replay): Filter out style
mutations when extracting DOM nodes
#83016
Conversation
We have an org that has a small handful of replays where the replayStepper causes massive perf issues to the extent that it freezes the browser. I narrowed it down to the `diff()` code inside of `rrdom` and a recent upstream PR (getsentry/rrweb#233) seems to have exacerbated the problem. I have not been able to figure out the root cause for the perf issues, but it seems to be related to CSS and the mutations that add `style` elements. We will want to try to identify what exactly in these replays are causing the perf issues. In the meantime we can filter out these mutations. Since we are only interested in generating and extracting the HTML for certain breadcrumb events, the styles should have no affect on the data we are interested in using. Closes #82221
e.type === EventType.IncrementalSnapshot && | ||
'source' in e.data && | ||
e.data.source === IncrementalSource.Mutation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i had this same bug! forgetting about FullSnapshot.
there's a new util to help:
import {isRRWebChangeFrame} from 'sentry/utils/replays/types';
in the other places where I've called the util i did not memoize it... because i was lazy and didn't add to ReplayReader; just chained some calls. That could probably be unified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, we don't care about full snapshots, only incremental
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I did copy&paste this from elsewhere though, so would be good to refactor into a helper)
…83016) We have an org that has a small handful of replays where the replayStepper causes massive perf issues to the extent that it freezes the browser. I narrowed it down to the `diff()` code inside of `rrdom` and a recent upstream PR (getsentry/rrweb#233) seems to have exacerbated the problem. I have not been able to figure out the root cause for the perf issues, but it seems to be related to CSS and the mutations that add `style` elements. We will want to try to identify what exactly in these replays are causing the perf issues. In the meantime we can filter out these mutations. Since we are only interested in generating and extracting the HTML for certain breadcrumb events, the styles should have no affect on the data we are interested in using. Closes #82221
We have an org that has a small handful of replays where the replayStepper
causes massive perf issues to the extent that it freezes the browser. I
narrowed it down to the
diff()
code inside ofrrdom
and a recent upstreamPR (getsentry/rrweb#233) seems to have exacerbated the
problem. I have not been able to figure out the root cause for the perf issues,
but it seems to be related to CSS and the mutations that add
style
elements.We will want to try to identify what exactly in these replays are causing the
perf issues.
In the meantime we can filter out these mutations. Since we are only interested
in generating and extracting the HTML for certain breadcrumb events, the styles
should have no affect on the data we are interested in using.
Closes #82221