Closed Bug 1520294 Opened 5 years ago Closed 5 years ago

Optimize nsFilterInstance allocation

Categories

(Core :: SVG, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: dholbert, Assigned: smaug)

References

Details

Attachments

(1 file)

See bug 1427417 comment 10 - it seems we've got some nsFilterInstance malloc/free churn shown in this profile: https://perfht.ml/2Ddr9dH

This is when hovering at https://kangax.github.io/compat-table/esnext/ , without webrender enabled.

Assignee: nobody → bugs

(In reply to Olli Pettay [:smaug] from comment #2)

and https://searchfox.org/mozilla-central/rev/c21d6620d384dfb13ede6054015da05a6353b899/gfx/src/FilterSupport.h#467 too ?
I don't know how large those arrays normally are.

Should be no more than 2. Most commonly 1, rarely 0 or 2.

The obvious fix to replace those with AutoTArray<, 2> crashes. Something very bogus looking objects in FilterSupport::ComputePostFilterExtents. I assume some copy or move constructor doens't quite work. I'll look tomorrow.

This helps a bit, but the filter code seems to be rather malloc heavy.
For example nsFilterInstance::ComputePostFilterExtents and nsCSSFilterInstance::SetBounds

Attachment #9036787 - Flags: review?(mstange)
Attachment #9036787 - Flags: review?(mstange) → review+
Depends on: 1520423
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cee37d07397c
make FilterPrimitiveDescription usage a tad less malloc heavy, r=mstange
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: