Avoid gBrowser.visibleTabs in _mouseenter()
Categories
(Firefox :: Tabbed Browser, task)
Tracking
()
People
(Reporter: Oriol, Assigned: Oriol)
References
(Blocks 1 open bug)
Details
(Keywords: perf:frontend)
Attachments
(1 obsolete file)
gBrowser.visibleTabs
is slow when there are lots of tabs.
If e.g. a thousand of tabs are removed, _setPositionalAttributes()
will be called lots of times, and if the user is hovering a tab, it will keep calling _mouseenter()
.
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
This patch won't improve performance by itself, since visibleTabs will
have been likely computed and cached in _setPositionalAttributes, but
it's the first step towards avoiding that work in hot code paths.
Note that previousVisibleTab and nextVisibleTab are not cached, so on
the worst case they may keep iterating several hidden tabs, but I think
it's fine given that most tabs are probably visible, and a cache may be
considered in the future. Also note that existing code was using linear
indexOf which wasn't great either.
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
This is already covered by https://phabricator.services.mozilla.com/D166094 from bug 1808661.
Description
•