-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Bug]: splitCssText causes degraded performance when recording #1603
Comments
Update on the reproduction steps above. I have also observed that when a |
I've a PR with a fix in #1615 While the benchmark demonstrates a huge difference in performance between the two cases, there's no actual improvement in the benchmark after the PR as it wasn't demonstrating the real pathological performance; the difference in the two bench timings was just reflecting the necessary call to `normalizeCssString` and accessing of childNodes content. I've instead made a pathological case out of your test html file, and added an Thanks so much for the bug report! |
@eoghanmurray Thanks for taking a look! TBH I didn't have a ton of time to analyze the benchmark I put up so what you described makes perfect sense. |
Hi, I was testing this after your fix and it seems that splitCssText hits the performance severely still. It freeze the screen for 10 secs. May I ask why we need this method? |
Preflight Checklist
What package is this bug report for?
rrweb
Version
v2.0.0-alpha.18
Expected Behavior
rrweb should not have a significant impact on an application/site when recording data.
Actual Behavior
Whenever
markCssSplits
is called, we have observed significantly degraded performance caused by splitCssText maxing out the JS heap.Steps to Reproduce
Reproduction steps with browser extensions:
In the wild, we were seeing this issue with customers who were using chrome extensions that are injecting CSS in to the page. We've seen the issue with our customers using the Grammarly browser extension and Sider AI browser extension. To reproduce the issue this way:
Simple reproduction steps (not using a browser extension):
http://127.0.0.1:8080
.// import { record } from './record.js';
and refresh the page.Testcase Gist URL
No response
Additional Information
Just for reference, here is the commit that added splitCssTest
This issue seems to be related, but looks to be more of a problem on the playback side (unless I am misunderstanding 😅 ).
Benchmark
IDK how helpful this would be, but I created a simple benchmark for splitCssText in
/packages/rrweb-snapshot/test/stringify-stylesheet.bench.ts
Here are the results I got:
Please let me know if there is any additional details I should provide. TY!
The text was updated successfully, but these errors were encountered: