Closed Bug 2054065 Opened 1 month ago Closed 27 days ago

[Nova] Switching tabs and interacting with extensions popup have become laggy in windows with large numbers of tabs

Categories

(Firefox :: Sidebar, defect, P1)

Firefox 152
defect

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox-esr153 --- disabled
firefox152 --- disabled
firefox153 --- disabled
firefox154 --- disabled
firefox155 --- fixed

People

(Reporter: ke5trel, Assigned: kcochrane)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: perf, regression, Whiteboard: [fidefe-sidebar])

Attachments

(1 file)

STR:

  1. Launch latest Nightly 154.0a1 with browser.nova.enabled = true.
  2. Use a session with a few thousand unloaded tabs.
  3. Install some extensions.
  4. Click extensions toolbar button and hover cursor over items.

Expected:
Popup opens quickly and hovered state responds immediately regardless of number of tabs like before.

Actual:
Popup opens slowly and hovered state takes seconds to respond, proportional to the number of tabs.

Happens regardless of sidebar visibility.

Performance profile:
https://share.firefox.dev/4vVOad5

Caused by sidebar.css addition:

  :root:has(#tabbrowser-tabpanels[splitview] .split-view-panel[column="0"].deck-selected) #sidebar-box:not([sidebar-positionend]) + #sidebar-splitter,
  :root:has(#tabbrowser-tabpanels[splitview] .split-view-panel[column="0"].deck-selected)
    #sidebar-container:not([sidebar-panel-open]):not([sidebar-positionend])
    + #sidebar-launcher-splitter {
    margin-inline-end: calc(-1 * var(--chrome-window-gap) + 3px);
  }

  :root:has(#tabbrowser-tabpanels[splitview] .split-view-panel[column="1"].deck-selected) #sidebar-box[sidebar-positionend] + #sidebar-splitter,
  :root:has(#tabbrowser-tabpanels[splitview] .split-view-panel[column="1"].deck-selected)
    #sidebar-container[sidebar-positionend]:not([sidebar-panel-open])
    + #sidebar-launcher-splitter {
    margin-inline-start: calc(-1 * var(--chrome-window-gap) + 3px);
  }

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=b9f53b8fb9dde343729b698e5202cf47284f53ef&tochange=1e2fcbc619b00e3645e6408492ccd9e4ac90ac55

Regressed by Bug 2023685.

:kcochrane, since you are the author of the regressor, bug 2023685, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(kcochrane)
Flags: needinfo?(kcochrane)
Whiteboard: [fidefe-sidebar]

Set release status flags based on info from the regressing bug 2023685

The severity field is not set for this bug.
:jsudiaman, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jsudiaman)

The same sidebar CSS selector also significantly slows tab switching with large numbers of tabs.

Performance profile when switching between two basic tabs, about:blank and about:mozilla:
Nova disabled: https://share.firefox.dev/3TpNrm0 (200ms jank)
Nova enabled: https://share.firefox.dev/4fCvzvy (600ms jank)

Summary: [Nova] Extensions popup has become laggy in windows with large numbers of tabs → [Nova] Switching tabs and interacting with extensions popup have become laggy in windows with large numbers of tabs
Severity: -- → S3
Flags: needinfo?(jsudiaman)
Priority: -- → P2
See Also: → 2059881

Marcus, Emilio, any thoughts on this? I haven't validated whether these recent changes to sidebar would've caused issues .. not sure why they would.

Flags: needinfo?(mstange.moz)
Flags: needinfo?(emilio)

:root:has() causes tons of extra work on every DOM mutation and invalidation. Please use something else to detect the state you care about.

Flags: needinfo?(emilio)

Can we add a lint to prevent the use of :has() in the main window? It's going to bite us for sure. Dao, wdyt? I could try to add one if given some direction :)

Flags: needinfo?(dao+bmo)
See Also: → 2060862

(In reply to Emilio Cobos Álvarez [:emilio] from comment #7)

Can we add a lint to prevent the use of :has() in the main window? It's going to bite us for sure. Dao, wdyt? I could try to add one if given some direction :)

Agreed, thanks for posting a patch in bug 2060862.

Flags: needinfo?(dao+bmo)

Kelly, could you pick this up next please? You'll need to change the use of :root:has() in browser/themes/shared/tabbrowser/content-area.css and browser/themes/shared/sidebar.css where emilio has added estlint-disable rule in bug 2060862.

Flags: needinfo?(mstange.moz) → needinfo?(kcochrane)
Assignee: nobody → kcochrane
Status: NEW → ASSIGNED
Flags: needinfo?(kcochrane)
Pushed by kcochrane@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/96c87b9a6e63 https://hg.mozilla.org/integration/autoland/rev/fea353a5dcf4 Rework instances of :root:has() in sidebar.css and content-area.css to resolve perf regression r=desktop-theme-reviewers,tabbrowser-reviewers,jsudiaman,dao
See Also: → 2059486
Status: ASSIGNED → RESOLVED
Closed: 27 days ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch

The patch landed in nightly and beta is affected, along with ESR.
:kcochrane, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(kcochrane)
Blocks: 2059486
See Also: 2059486
Regressions: 2063983
No longer regressions: 2063983
QA Whiteboard: [qa-triage-done-c156/b155]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: