Closed Bug 1385324 Opened 7 years ago Closed 7 years ago

HTMLFormControlsCollection::GetSortedControls() is very malloc heavy

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

See this profile: https://perfht.ml/2v6ntHb

The nsTArray there needs to have some preallocated space.
Attachment #8891405 - Attachment is obsolete: true
Attachment #8891405 - Flags: review?(kyle)
Attachment #8891404 - Flags: review?(kyle) → review+
Attachment #8891426 - Flags: review?(kyle) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/485ceaeda922
Part 1: Use a preallocated buffer of 100 elements to try to avoid memory allocations in HTMLFormControlsCollection::GetSortedControls(); r=qdot
https://hg.mozilla.org/integration/mozilla-inbound/rev/1ba4cfc4fa62
Part 2: Rewrite HTMLFormControlsCollection::GetSortedControls() to use RefPtr instead of raw pointers; r=qdot
https://hg.mozilla.org/mozilla-central/rev/485ceaeda922
https://hg.mozilla.org/mozilla-central/rev/1ba4cfc4fa62
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.