Last Comment Bug 822914 - Improve gBrowser.selectedTab getter efficiency
: Improve gBrowser.selectedTab getter efficiency
Status: RESOLVED FIXED
: perf
Product: Firefox
Classification: Client Software
Component: Tabbed Browser (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 20
Assigned To: ithinc
:
Mentors:
: 817373 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-18 17:31 PST by ithinc
Modified: 2013-02-28 12:38 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (10.03 KB, patch)
2012-12-18 18:36 PST, ithinc
no flags Details | Diff | Review
patch v2 (7.23 KB, patch)
2012-12-20 03:10 PST, ithinc
no flags Details | Diff | Review
patch v3 (1.86 KB, patch)
2012-12-28 23:21 PST, ithinc
dao+bmo: review+
Details | Diff | Review

Description ithinc 2012-12-18 17:31:15 PST
And replace (aTab == this.selectedTab) with aTab.selected. .selectedTab getter seems more expensive than .mCurrentTab.
Comment 1 ithinc 2012-12-18 18:36:55 PST
Created attachment 693717 [details] [diff] [review]
patch
Comment 2 Dão Gottwald [:dao] 2012-12-19 05:34:19 PST
Comment on attachment 693717 [details] [diff] [review]
patch

The tab.selected changes are fine, but we should make selectedTab fast rather than using mCurrentTab.
Comment 3 ithinc 2012-12-20 00:17:25 PST
So maybe selectedTab getter could return mCurrentTab directly, and use tabContainer.selectedItem instead when necessary?
Comment 4 Dão Gottwald [:dao] 2012-12-20 01:52:52 PST
This sounds reasonable.
Comment 5 ithinc 2012-12-20 03:10:36 PST
Created attachment 694316 [details] [diff] [review]
patch v2

I'm not sure whether there is some risk. I'm testing it in my profile.
Comment 6 ithinc 2012-12-28 23:21:00 PST
Created attachment 696460 [details] [diff] [review]
patch v3

It just works.
Comment 7 Ryan VanderMeulen [:RyanVM] 2012-12-29 07:18:54 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/0b34087f3e7d
Comment 8 :Ehsan Akhgari (busy, don't ask for review please) 2012-12-29 17:19:36 PST
https://hg.mozilla.org/mozilla-central/rev/0b34087f3e7d
Comment 9 Mike Hommey [:glandium] 2013-02-28 05:29:05 PST
*** Bug 817373 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.