HTMLFormControlsCollection::GetSortedControls() is very malloc heavy

RESOLVED FIXED in Firefox 56

Status

()

defect
RESOLVED FIXED
2 years ago
4 months ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

(Blocks 1 bug)

unspecified
mozilla56
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(2 attachments, 1 obsolete attachment)

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: 2 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.