Closed Bug 1718337 Opened 3 years ago Closed 3 years ago

Resizing a window with lots of tabs spends a lot of time in style

Categories

(Core :: CSS Parsing and Computation, task)

task

Tracking

()

RESOLVED FIXED
91 Branch
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?

Flags: needinfo?(emilio)

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

We should be able to do better here.

Assignee: nobody → emilio

I confirmed that we were doing a full restyle because of that. The attached patch should improve things significantly.

Flags: needinfo?(emilio)

This should speed up window resize significantly.

Blocks: 1718384

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.

Flags: needinfo?(jmuizelaar)

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.

Flags: needinfo?(jmuizelaar)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/58909c79343b
More fine-grained viewport units invalidation. r=layout-reviewers,jfkthame
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Regressions: 1720117
Regressions: 1733475
Regressions: 1738925
Blocks: 1300879
Duplicate of this bug: 1648220
Duplicate of this bug: 1684259
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: