Switch-to-tab is slow with lots of tabs

NEW
Unassigned

Status

()

Firefox
Tabbed Browser
4 years ago
3 months ago

People

(Reporter: ttaubert, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
Having lots of tabs open slows done switch-to-tab. We currently iterate all tabs until we hit one with the right URL. As nsPlacesAutoComplete is updated per onLocationChange() notification we should probably do the same here and maintain a map that maps tabs to urls and offer gBrowser.switchToTabHavingURI() method that uses it?
Another possible approach would be to implement a getTabForURL that did a properly optimized search instead of brute force iteration over the set.

It would probably be fast enough, and use less memory than creating a new in-memory cache.
(Reporter)

Comment 2

4 years ago
We could go the way of bug 964349 and update URLs for tabs in onLocationChange(). We could probably use WeakRefs so that we don't need to listen for TabClose events.

(In reply to Dietrich Ayala (:dietrich) from comment #1)
> Another possible approach would be to implement a getTabForURL that did a
> properly optimized search instead of brute force iteration over the set.

Sorry, I'm not sure what you mean by doing a properly optimized search without using an in-memory cache? How would you go about that?
You need to log in before you can comment on or make changes to this bug.