-
-
Notifications
You must be signed in to change notification settings - Fork 412
fix: Optimize splitShadowRootCss
#1934
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
fix: Optimize splitShadowRootCss
#1934
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
splitShadowRootCsssplitShadowRootCss
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.
Nice, great find. I need to get better at this sort of performance optimization.
splitShadowRootCsssplitShadowRootCss
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1934 +/- ##
==========================================
- Coverage 81.31% 81.29% -0.03%
==========================================
Files 131 131
Lines 6680 6677 -3
Branches 1096 1098 +2
==========================================
- Hits 5432 5428 -4
- Misses 1238 1239 +1
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/runner
@wxt-dev/storage
@wxt-dev/unocss
@wxt-dev/webextension-polyfill
wxt
commit: |
|
Thanks for helping make WXT better! |
Overview
I did some benchmarking in my prod. ext. and noticed that ~8% (~65ms) of the initial page render time is spent in
splitShadowRootCss. It is pretty unoptimized right now and this PR changes that.Main problem with the original one seems to be GC and regex related:
Original:

Optimized:

Manual Testing
Benchmark script (copy and paste this in the Chrome dev tools, ai generated):
Related Issue
None