Perfomance issues when reopening a Tab group with over 200 tabs
Categories
(Firefox :: Tabbed Browser, defect, P3)
Tracking
()
People
(Reporter: rdoghi, Assigned: sthompson)
References
(Blocks 4 open bugs)
Details
(Keywords: perf, Whiteboard: [fidefe-tabgrps-tabbrowser])
Attachments
(2 files)
Found in
- 138.0a1 (2025-03-12)
Affected versions
- 138.0a1 (2025-03-12)
Affected platforms
- All
Steps to reproduce
- Have a Tab group with 200 tabs.
- Save and Close the Tab group.
- Reopen the tab group from the list all tabs menu.
Expected result
- The tab group should be restored without any performance issues.
Actual result
- Sometimes the Firefox browser will freeze for a few seconds and it will fail to respond.
Regression range
Its not really a regression of Bug 1952902, but since the limit is no longer 25 tabs per group, we are seeing some performance issues when a lot of tabs are involved.
Here is the performance profile for this issue.
https://share.firefox.dev/4ilkmj9
Updated•13 days ago
|
Updated•13 days ago
|
Assignee | ||
Comment 1•13 days ago
|
||
We are doing the performant thing by dropping all restored tabs into the restored tab group at once, but we have an unfortunate side effect right now where each restored tab is firing a TabGrouped event and each of those causes the TOM menu all tabs list to be completely rebuilt. All of those DOM interactions in the TOM menu are causing things to chug.
https://searchfox.org/mozilla-central/source/browser/components/tabbrowser/TabsList.sys.mjs#66
We're responding to TabGrouped events in the TOM menu all tabs list in order to keep the TOM menu looking live and up to date for TOM menu users, but I guess the simple and naive "rebuild it each time" doesn't work so well when restoring a large tab group
Comment 2•12 days ago
|
||
Yeah at least batching at requestAnimationFrame time seems it would be easy?
Assignee | ||
Comment 3•12 days ago
|
||
The tab overflow menu's tabs list started listening for tab groups' events in order to refresh the tabs list and keep it in sync with the state of the tab strip. However, for operations that affect large tab groups all at once (restoring a closed tab group, closing a tab group), the tab group fires one event per tab all at once. This causes the tabs list to re-render itself once per tab, which is a lot of work for large tab groups.
The current use cases for the TabGrouped
and TabUngrouped
events do not require any context about each individual tab, so it's possible to just fire a single event when any number of tabs are added/removed at one time. This should address the performance issue with the tabs list.
Updated•12 days ago
|
Updated•12 days ago
|
Updated•12 days ago
|
Reporter | ||
Comment 6•6 days ago
|
||
This issue is verified as fixed in our latest Nightly build 138.0a1 (2025-03-19) however, When we duplicate 120 tabs, it takes a long time for the tab strip to recover, it takes a long time to create a tab group or to open the List all tabs menu right after duplicating tabs, it might be normal ? after the websites finally load everything works great, should I log a separate issue for this ?
Assignee | ||
Comment 7•6 days ago
|
||
(In reply to Rares Doghi, Desktop QA from comment #6)
This issue is verified as fixed in our latest Nightly build 138.0a1 (2025-03-19) however, When we duplicate 120 tabs, it takes a long time for the tab strip to recover, it takes a long time to create a tab group or to open the List all tabs menu right after duplicating tabs, it might be normal ? after the websites finally load everything works great, should I log a separate issue for this ?
Yes, I think it would be helpful to track it as a separate issue. I made a performance profile while duplicating 300 tabs and most of the time is spent laying out the content of the new tabs. I don't think we have changed anything about how we handle the content of tabs, so I expect that this is a performance issue unrelated to any tab groups changes. I can confirm that the browser hangs and is unresponsive.
It looks to me like the code for duplicating tabs is asking for the newly duplicated tabs to immediately load their contents. I think it would be a good performance enhancement to only create the duplicate tabs when the user chooses to duplicate, and only have the tab contents loaded when the user selects a tab(s).
Reporter | ||
Comment 8•6 days ago
|
||
Added Bug 1955049 for the separate issue.
Description
•