Resizing a window with lots of tabs spends a lot of time in style
Categories
(Core :: CSS Parsing and Computation, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: jrmuizel, Assigned: emilio)
References
(Regressed 1 open bug)
Details
Attachments
(1 file)
https://share.firefox.dev/3h733Eb.
I guess we have too many elements?
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Well we're restyling 13k elements every time, but it's quite terrible that we end up restyling the whole browser for a resize... It seems the front-end uses viewport units in some places and that causes us to hit this code path presumably: https://searchfox.org/mozilla-central/rev/cd2a6bb5cbe288efd3268cbf9ceae169171a3fe9/layout/style/ServoStyleSet.cpp#246
Assignee | ||
Comment 3•3 years ago
|
||
I confirmed that we were doing a full restyle because of that. The attached patch should improve things significantly.
Assignee | ||
Comment 4•3 years ago
|
||
This should speed up window resize significantly.
Comment 5•3 years ago
|
||
Jeff, I'm curious how you captured the profile here? I was experimenting a bit to try and see how much impact the patch here has, but I'm finding it difficult to reliably reproduce the long restyle behavior. I'm using a profile where I have rather more than 500 tabs in a window; when resizing it by dragging the corner around, sometimes I see several long restyles (in the 70-100ms range) in the parent process, but other times, doing (as near as I can tell) the same thing, this doesn't show up at all.
Assignee | ||
Comment 6•3 years ago
|
||
Bug 1718384 should've fixed the usage of viewport units in the main browser window, which should've "fixed" this. The patch is still worth it imo.
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/58909c79343b More fine-grained viewport units invalidation. r=layout-reviewers,jfkthame
Comment 8•3 years ago
|
||
bugherder |
Description
•