Closed Bug 750583 Opened 12 years ago Closed 12 years ago

FUEL gShutdown array uses an n^2 algorithm to empty the array, causing huge shutdown times

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15
Tracking Status
firefox12 --- wontfix
firefox13 --- verified
firefox14 --- fixed
firefox15 --- fixed
firefox-esr10 --- wontfix

People

(Reporter: pcwalton, Assigned: pcwalton)

References

Details

(Keywords: perf, Whiteboard: [snappy][qa+])

Attachments

(1 file)

Attached patch Proposed patch.Splinter Review
For months I've been getting minute-long shutdown times after using the browser for a long time. I managed to turn up the following culprit in FUEL:

http://mxr.mozilla.org/mozilla-central/source/toolkit/components/exthelper/extApplication.js#594

Which is an n^2 loop for clearing out an array. Indeed most of the cost is in memmove.

The question is why this array is getting so big. I suspect it's an addon using FUEL inappropriately. In the meantime, at least we can speed up the emptying of the array.

Apologies if this is misfiled, as I have no idea who maintains FUEL...
Attachment #619808 - Flags: review?(dtownsend+bugmail)
> The question is why this array is getting so big.

Because FUEL's management of this array is totally broken.  See bug 750454 which bent filed today.  The patch here helps the memmove issue, but not the memory leaks FUEL is causing here.
Duping over to bug 750454.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Unduping per #content.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Attachment #619808 - Flags: review?(dtownsend+bugmail) → review?(justin.lebar+bug)
Attachment #619808 - Flags: review?(justin.lebar+bug) → review+
https://hg.mozilla.org/mozilla-central/rev/139e8e845aa5
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
Comment on attachment 619808 [details] [diff] [review]
Proposed patch.

[Approval Request Comment]
Case for branch / ESR consideration: Bad bug (causes very long shutdown times), trivial fix.
Fix Landed on Version: FF15
Risk to taking this patch (and alternatives if risky): Trivial change.
String changes made by this patch: None.
Attachment #619808 - Flags: approval-mozilla-esr10?
Attachment #619808 - Flags: approval-mozilla-beta?
Attachment #619808 - Flags: approval-mozilla-aurora?
Comment on attachment 619808 [details] [diff] [review]
Proposed patch.

happy to get these perf wins on beta/aurora, but denying for ESR since there's no current requests for this with the enterprise users.
Attachment #619808 - Flags: approval-mozilla-esr10?
Attachment #619808 - Flags: approval-mozilla-esr10-
Attachment #619808 - Flags: approval-mozilla-beta?
Attachment #619808 - Flags: approval-mozilla-beta+
Attachment #619808 - Flags: approval-mozilla-aurora?
Attachment #619808 - Flags: approval-mozilla-aurora+
(In reply to Lukas Blakk [:lsblakk] from comment #8)
> happy to get these perf wins on beta/aurora, but denying for ESR since
> there's no current requests for this with the enterprise users.

That's OK, I don't care about the enterprise.  :-P

https://hg.mozilla.org/releases/mozilla-aurora/rev/fb8127fcaac4
https://hg.mozilla.org/releases/mozilla-beta/rev/303d987789c5

QA: If you'd like to verify this fix, you're probably best off installing an old version of the Readibility add-on (bug 730546) and trying to coax it into creating a lot of objects.  Things like switching tabs create new objects with the old Readability.  I don't have a solid test-case; you will have to experiment, unless pcwalton has better STR.
We'll try to verify this using the suggestions in comment 9.
Whiteboard: [snappy] → [snappy][qa+]
Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20100101 Firefox/13.0
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0

Used the steps from comment #9, but could not reproduce the issue: Firefox closed normally.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: