Cache gBrowser.tabContainer.allTabs instead of gBrowser.tabs
Categories
(Firefox :: Tabbed Browser, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: Oriol, Assigned: Oriol)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
gBrowser.tabs
is cached:
get tabs() {
if (!this._tabs) {
this._tabs = this.tabContainer.allTabs;
}
return this._tabs;
},
However, some tabContainer
code accesses allTabs
directly, which is not cached.
It seems to me that gBrowser.tabContainer.allTabs
should be cached, and gBrowser.tabs
should just redirect to gBrowser.tabContainer.allTabs
.
I haven't identified a case where this causes perf problems, but it's a trivial refactoring.
Assignee | ||
Comment 1•2 years ago
|
||
gBrowser.tabs was either redirecting to gBrowser.tabContainer.allTabs or
using the previously cached result. However, most tabContainer code uses
allTabs directly, which was not benefiting from the cache.
Therefore, this patch caches gBrowser.tabContainer.allTabs, and makes
gBrowser.tabs always redirect to it.
Also makes it consistent for gBrowser.tabContainer._getVisibleTabs() and
gBrowser.visibleTabs. In that case both the logic and the cache were in
gBrowser, and tabContainer was redirecting to that, except when gBrowser
hadn't been initialized.
So it's better to have both the logic and the cache in tabContainer.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
D166962 is moving the cache into gBrowser.tabContainer, so the methods
for invalidating it should also be there.
Depends on D166962
Comment 5•2 years ago
|
||
bugherder |
Comment 6•2 years ago
|
||
bugherder |
Description
•