Closed Bug 1996984 Opened 1 year ago Closed 1 year ago

Dragging a tab group in a window with many tabs hangs the browser for about 30 seconds

Categories

(Firefox :: Tabbed Browser, defect)

defect

Tracking

()

VERIFIED FIXED
146 Branch
Performance Impact ?
Tracking Status
firefox-esr140 --- unaffected
firefox144 --- unaffected
firefox145 --- unaffected
firefox146 --- verified
firefox147 --- verified

People

(Reporter: handyman, Assigned: nsharpley)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

I've got a few thousand tabs open in a window and, when I try to drag a tab group in that window, the drag icon doesn't get more than a tab or two away before the (entire) browser hangs for 30 seconds. After that, the browser performs normally. A profile is here.

Some stats:

  • I have four windows open. One has thousands of tabs, one has hundreds, and two have about a dozen. In the windows with dozens or hundreds of tabs, I can drag tab groups freely. This only happens in the other window.
  • I've tried troubleshooting mode -- no change.
  • Dragging normal tabs works fine.
  • The tab group has about a 10 entries.

I just had the same experience in the same window, but this time it was just dragging a tab, not a tab group. It seems to be happening somewhat reliably. Here is the profile for dragging one tab.

Here's a similar profile from vchin: https://share.firefox.dev/47gNKEk

It looks like what's happening is that the _updateTabStylesOnDrag method in tab-stacking.js is layout thrashing - for each tab in the tab strip, it is updating styles on that tab, then getting the client rect, so we're synchronously flushing layout once per tab. That's going to get very slow, especially for many tabs, and especially on slower machines.

This might be a dupe of bug 1996863.

Keywords: regression
Regressed by: 1983124
See Also: → 1996863
Performance Impact: --- → ?

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

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

For more information, please visit BugBot documentation.

Hey handyman,

If you set browser.tabs.dragDrop.multiselectStacking to false, does the performance problem go away?

Flags: needinfo?(davidp99)
Assignee: nobody → nsharpley
Status: NEW → ASSIGNED
Flags: needinfo?(nsharpley)
Pushed by nsharpley@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/92c534d4bfa3 https://hg.mozilla.org/integration/autoland/rev/bfa5b456eceb Swap getBoundingClientRect for getBoundsWithoutFlushing in tab stacking r=tabbrowser-reviewers,sthompson

(In reply to Mike Conley (:mconley) (:⚙️) from comment #6)

Hey handyman,

If you set browser.tabs.dragDrop.multiselectStacking to false, does the performance problem go away?

It is much better -- it's basically interactive speed. It feels a bit jankier than I recall in the past, but, with this many tabs, it was always finicky, so I can't guarantee that is an actual performance change. I can get pauses of about a second while dragging but mostly it is smooth.

Flags: needinfo?(davidp99)

Okay, thank you! I'll be very interested in knowing what the browser.tabs.dragDrop.multiselectStacking set to true experience is like after nsharpley's patch shows up in the next Nightly!

Flags: needinfo?(davidp99)
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch

(In reply to Mike Conley (:mconley) (:⚙️) from comment #10)

Okay, thank you! I'll be very interested in knowing what the browser.tabs.dragDrop.multiselectStacking set to true experience is like after nsharpley's patch shows up in the next Nightly!

Fixed! With browser.tabs.dragDrop.multiselectStacking set back to true, the new nightly looks good -- similar to how it looked with false before.

Flags: needinfo?(davidp99)
QA Whiteboard: [qa-triage-done-c147/b146][qa-ver-needed-c147/b146]
Flags: qe-verify+

I was able to reproduce it on Win11x64 using FF build 146.0a1(20251028215909), after loading lots of bookmarks.
Verified as fixed on Win11x64 using FF builds 146.0b2 and 147.0a1.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triage-done-c147/b146][qa-ver-needed-c147/b146] → [qa-triage-done-c147/b146][qa-ver-done-c147/b146]
Flags: qe-verify+
QA Contact: mchiorean
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: