Improve gBrowser.selectedTab getter efficiency

RESOLVED FIXED in Firefox 20

Status

()

Firefox
Tabbed Browser
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: ithinc, Assigned: ithinc)

Tracking

({perf})

Trunk
Firefox 20
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
And replace (aTab == this.selectedTab) with aTab.selected. .selectedTab getter seems more expensive than .mCurrentTab.
(Assignee)

Comment 1

5 years ago
Created attachment 693717 [details] [diff] [review]
patch
Attachment #693717 - Flags: feedback?(dao)
Comment on attachment 693717 [details] [diff] [review]
patch

The tab.selected changes are fine, but we should make selectedTab fast rather than using mCurrentTab.
Attachment #693717 - Flags: feedback?(dao)
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 3

5 years ago
So maybe selectedTab getter could return mCurrentTab directly, and use tabContainer.selectedItem instead when necessary?
This sounds reasonable.
(Assignee)

Comment 5

5 years ago
Created attachment 694316 [details] [diff] [review]
patch v2

I'm not sure whether there is some risk. I'm testing it in my profile.
Attachment #693717 - Attachment is obsolete: true
(Assignee)

Comment 6

5 years ago
Created attachment 696460 [details] [diff] [review]
patch v3

It just works.
Attachment #694316 - Attachment is obsolete: true
Attachment #696460 - Flags: review?(dao)

Updated

5 years ago
Attachment #696460 - Flags: review?(dao) → review+

Updated

5 years ago
Assignee: nobody → ithinc
Keywords: checkin-needed, perf
OS: Windows 7 → All
Hardware: x86_64 → All
Summary: Replace .selectedTab with .mCurrentTab in tabbrowser.xml when possible → Improve gBrowser.selectedTab getter efficiency
https://hg.mozilla.org/integration/mozilla-inbound/rev/0b34087f3e7d
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0b34087f3e7d
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Duplicate of this bug: 817373
You need to log in before you can comment on or make changes to this bug.