Closed
Bug 817373
Opened 12 years ago
Closed 11 years ago
tabbox's selectedItem induces O(N^2) type algorithms with e.g. panorama
Categories
(Toolkit :: UI Widgets, defect)
Toolkit
UI Widgets
Tracking
()
RESOLVED
DUPLICATE
of bug 822914
People
(Reporter: glandium, Unassigned)
Details
(Whiteboard: [Snappy:?])
When opening Panorama for the first time, GroupItems initializes. For each tab, there is a "tab == gBrowser.selectedTab" test, and gBrowser.selectedTab ends up in tabbox's selectedItem, which goes through all tabs to see if the selected flag is set. This is O(N^2), and makes opening panorama take more than 10s on my (crazy) 1400 tabs window, entirely blocking the UI. See the profile on http://bit.ly/SDB0KB Arguably, the Panorama code could be checking the selected flag directly, but i guess tabbox's goal is to hide this implementation detail...
Reporter | ||
Updated•12 years ago
|
Whiteboard: [Snappy:?]
Comment 1•11 years ago
|
||
I agree, that's horrible but gBrowser.selectedTab is a quite old API. Is there no cache for that property? We certainly don't need to iterate over all tabs every time we access it.
Comment 2•11 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #0) > When opening Panorama for the first time, GroupItems initializes. For each > tab, there is a "tab == gBrowser.selectedTab" test, and gBrowser.selectedTab > ends up in tabbox's selectedItem, which goes through all tabs to see if the > selected flag is set. https://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#2155 gBrowser.selectedTab does not iterate over all tabs, afaict. Am I missing something here?
Reporter | ||
Comment 3•11 years ago
|
||
(In reply to Tim Taubert [:ttaubert] from comment #2) > https://mxr.mozilla.org/mozilla-central/source/browser/base/content/ > tabbrowser.xml#2155 > > gBrowser.selectedTab does not iterate over all tabs, afaict. Am I missing > something here? bug 822914, apparently :)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Reporter | ||
Comment 4•11 years ago
|
||
Although arguably, tabbox's selectedItem is still awful.
You need to log in
before you can comment on or make changes to this bug.
Description
•