Open Bug 1590057 Opened 5 years ago Updated 13 days ago

Fullscreen switching is slow with many tabs

Categories

(Core :: Graphics, defect, P3)

69 Branch
x86_64
Linux
defect

Tracking

()

Performance Impact low
Tracking Status
firefox68 --- unaffected
firefox69 --- wontfix
firefox70 --- wontfix
firefox71 --- wontfix
firefox72 --- wontfix
firefox73 --- fix-optional

People

(Reporter: slash, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: perf, perf:responsiveness, regression)

Attachments

(6 files)

Attached file 800 tabs session

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0

Steps to reproduce:

  1. Open 800 tabs (attached session data)
  2. Quit
  3. Restart
  4. Restore session
  5. Press F11

Actual results:

Firefox 69 is slower than firefox 68

Expected results:

Firefox 69 is as fast as firefox 68

Attached video firefox 68
Attached video firefox 69

Would you like to try Firefox Nightly 71? Full screen code is being rewritten (bug 1505916).

Component: Untriaged → General
OS: Unspecified → Linux
Hardware: Unspecified → x86_64

Nightly 71 is slow too.

Fission Milestone: --- → ?

It is likely too late to do anything about this for 70. But we'll see how Fission work helps for 72 and maybe even 71.

mozregression:
10:41.06 INFO: Narrowed inbound regression window from [6c6b0bbf, 8f15ea3b] (3 builds) to [6c6b0bbf, 5a18f5c9] (2 builds) (~1 steps left)
10:41.06 INFO: No more inbound revisions, bisection finished.
10:41.06 INFO: Last good revision: 6c6b0bbf5885493a0b85cedf1985d6eb3bdbfe6f
10:41.06 INFO: First bad revision: 5a18f5c929ab13bde25f7fff8ae72f87e8fa379c
10:41.06 INFO: Pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=6c6b0bbf5885493a0b85cedf1985d6eb3bdbfe6f&tochange=5a18f5c929ab13bde25f7fff8ae72f87e8fa379c

Regressed by: 1549976
Component: General → Graphics: WebRender
Product: Firefox → Core
Whiteboard: [fxperf]
Flags: needinfo?(gijskruitbosch+bugs)
Flags: needinfo?(dothayer)
Priority: -- → P3

Do you see this on a clean profile? Have you toggled gfx.webrender.split-render-roots to true on the profile where you see this?

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(slash)
Whiteboard: [fxperf] → [fxperf:p3]
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file about:support

(In reply to :Gijs (he/him) from comment #7)

Do you see this on a clean profile?
I tested with a new profile.

Have you toggled gfx.webrender.split-render-roots to true on the profile where you see this?
It's set to false. Setting it to true doesn't change anything.
WebRender seems disabled. Please see the attached about:support.

Flags: needinfo?(slash)

I'm stumped, tbh. There's nothing in the about:support data that stands out to me (though it may be worth someone more in tune with the finesses of gfx to take a look - nical?), the change in bug 1549976 I don't think should have affected non-webrender, and I can't tell what's going on in the videos - they move a lot from left-to-right? I don't really understand why - does the same issue not happen if you're going from a maximized window to fullscreen?

One more stab in the dark: on the clean profile, if you toggle toolkit.legacyUserProfileCustomizations.stylesheets to true in about:config, close Firefox, and create a chrome folder in your profile with a userChrome.css file containing:

html|*#fullscreen-and-pointerlock-wrapper {
  display: none;
}

and reopen Firefox, does the problem go away? (You probably don't want to keep that long-term because it'll break pointerlock and fullscreen warnings.)

It's also possible gecko profiles for the before/after would help, but tbh from the video it's not clear to me that there's really a significant difference in how quickly anything happens? It looks maybe more stuttery in 69 (though even that's hard to see because of the horizontal back-and-forth), but not slower in a wall-clock-time sense, and it may be hard to make out the difference in a profile.

Flags: needinfo?(slash)
Flags: needinfo?(nical.bugzilla)

(In reply to :Gijs (he/him) from comment #9)
userChrome.css doesn't help.
Removing #fullscreen-and-pointerlock-wrapper from browser.xhtml makes fullscreen by F11 fast. But fullscreen by video element is still slow.
I'll attach new videos. They'll show the problem clearer.

Flags: needinfo?(slash)

Can you use the Firefox Profiler add-on to get profiles of the good/bad behaviour in the 3000 tabs case?

Flags: needinfo?(slash)
Flags: needinfo?(slash)

From the profiles, looks like stylo is where things are happening, which I don't know much about. Looks like a lock in Servo_CssUrlData_Release is contended, but I don't know with what (the stylo workers are not recorded in the profile).

Moving from WebRender to the Graphics component since the former does not affect the issue, but I doubt the answer will actually be Graphics.

Perhaps the change in the regression range or some other change that happened around the same time nudged some heuristics somewhere which led more items to be considered by the style system when thousands of (hidden) tabs are present?

Component: Graphics: WebRender → Graphics
Flags: needinfo?(nical.bugzilla)

P3, unassigned, so wontfix for 71 given where we are in the schedule.

Fission Milestone: ? → ---

The most suspicious thing I see in this profile is that we spend almost 700ms in Servo_CssUrlData_Release waiting on a lock during the two reflows. That said, the rest of the stacks don't make much sense, so it's not clear what's actually triggering the reflows, or even whether the parts of the stacks that seem to make sense are actually trustworthy. I'm not sure whether this is because of improper symbolication or just because of the way the code is optimized.

Marking fix-optional to remove this from weekly regression triage.

See Also: → 1253270
See Also: → 950966
Has Regression Range: --- → yes
Severity: normal → S3
Blocks: 1808711
Performance Impact: --- → low
Whiteboard: [fxperf:p3]
Flags: needinfo?(dothayer)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: