Make tabbrowser's ".browsers" property faster

RESOLVED FIXED

Status

RESOLVED FIXED
13 years ago
10 years ago

People

(Reporter: csthomas, Assigned: csthomas)

Tracking

({fixed-seamonkey1.1a})

Trunk
x86
All
fixed-seamonkey1.1a

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 2 obsolete attachments)

Neil mentioned on IRC that we access this.browsers in loops, and currently build the array each time in the getter.  Jag seems to think we should cache the array after it's built.
Created attachment 222239 [details] [diff] [review]
better patch

I left out a small detail in the previous version.
Attachment #222237 - Attachment is obsolete: true

Comment 3

13 years ago
Comment on attachment 222239 [details] [diff] [review]
better patch

I think I'd prefer

  if (!this._browsers) {
    ...
    this._browsers = browsers;
  }
  return this._browsers;

but other than that, yeah, that should do the trick.
Created attachment 222351 [details] [diff] [review]
single exit point
Assignee: jag → cst
Attachment #222239 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #222351 - Flags: review?(jag)
Comment on attachment 222351 [details] [diff] [review]
single exit point

<jag> r+sr=jag then
<jag> Oooh, get Neil's sr
<CTho> NeilAway: the SR question was about bug 338180
<NeilAway> CTho: but if it's the .browser cache, sr=me
Attachment #222351 - Flags: superreview+
Attachment #222351 - Flags: review?(jag)
Attachment #222351 - Flags: review+
Checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Attachment #222351 - Flags: approval-seamonkey1.1a?

Comment 7

13 years ago
Comment on attachment 222351 [details] [diff] [review]
single exit point

a=me for SeaMonkey 1.1
Attachment #222351 - Flags: approval-seamonkey1.1a? → approval-seamonkey1.1a+
Keywords: fixed-seamonkey1.1a

Comment 8

13 years ago
Would this apply to FF?  Would it improve perf?

~B
(In reply to comment #8)
> Would this apply to FF?
Yes

> Would it improve perf?
Probably not enough to notice, but it should still be done.

Updated

10 years ago
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.