Closed Bug 822914 Opened 12 years ago Closed 12 years ago

Improve gBrowser.selectedTab getter efficiency

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 20

People

(Reporter: tabutils+bugzilla, Assigned: tabutils+bugzilla)

References

Details

(Keywords: perf)

Attachments

(1 file, 2 obsolete files)

And replace (aTab == this.selectedTab) with aTab.selected. .selectedTab getter seems more expensive than .mCurrentTab.
Attached patch patch (obsolete) — Splinter Review
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
So maybe selectedTab getter could return mCurrentTab directly, and use tabContainer.selectedItem instead when necessary?
This sounds reasonable.
Attached patch patch v2 (obsolete) — Splinter Review
I'm not sure whether there is some risk. I'm testing it in my profile.
Attachment #693717 - Attachment is obsolete: true
Attached patch patch v3Splinter Review
It just works.
Attachment #694316 - Attachment is obsolete: true
Attachment #696460 - Flags: review?(dao)
Attachment #696460 - Flags: review?(dao) → review+
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/mozilla-central/rev/0b34087f3e7d
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: