The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in Firefox 13

Status

()

Core
General
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: pcwalton, Assigned: pcwalton)

Tracking

({perf})

unspecified
mozilla15
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox12 wontfix, firefox13 verified, firefox14 fixed, firefox15 fixed, firefox-esr10 wontfix)

Details

(Whiteboard: [snappy][qa+])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 619808 [details] [diff] [review]
Proposed patch.

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.
(Assignee)

Comment 2

5 years ago
Duping over to bug 750454.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 750454
(Assignee)

Comment 3

5 years ago
Unduping per #content.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
(Assignee)

Updated

5 years ago
Attachment #619808 - Flags: review?(dtownsend+bugmail) → review?(justin.lebar+bug)
Attachment #619808 - Flags: review?(justin.lebar+bug) → review+
Blocks: 750454
Duplicate of this bug: 750469
Blocks: 750953
(Assignee)

Comment 5

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/139e8e845aa5
https://hg.mozilla.org/mozilla-central/rev/139e8e845aa5
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago5 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.
status-firefox-esr10: --- → wontfix
status-firefox12: --- → wontfix
status-firefox13: --- → fixed
status-firefox14: --- → fixed
status-firefox15: --- → fixed
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.
status-firefox13: fixed → verified
You need to log in before you can comment on or make changes to this bug.