Closed Bug 1808721 Opened 3 years ago Closed 3 years ago

showTab and hideTab shouldn't invalidate cached _tabs

Categories

(Firefox :: Tabbed Browser, task)

task

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: Oriol, Assigned: Oriol)

References

(Blocks 1 open bug)

Details

(Keywords: perf:frontend)

Attachments

(1 file)

showTab and hideTab call _invalidateCachedTabs:

    _invalidateCachedTabs() {
      this._tabs = null;
      this._visibleTabs = null;
    },

Of course _visibleTabs needs to be invalidated when a tab visibility changes, but I don't see the need to invalidate _tabs.

Recomputing gBrowser.tabs can be slow when there are thousands of tabs, so better to not invalidate the cache unnecessarily.

Probably not a big deal since I don't think showTab and hideTab are frequently used, but the improvement is trivial.

Invalidating cached _visibleTabs should be enough.

Assignee: nobody → oriol-bugzilla
Status: NEW → ASSIGNED
Type: enhancement → task
Pushed by oriol-bugzilla@hotmail.com: https://hg.mozilla.org/integration/autoland/rev/b7c21d63bd62 Stop invalidating cached _tabs from showTab and hideTab. r=dao
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: