Closed Bug 1607836 Opened 4 years ago Closed 4 years ago

recycle render task graph allocations

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: nical, Assigned: nical)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

On pages with a lot of filters (for example lots of small shadows), pushing into the render task graph's vectors show up in profiles.

It should be pretty easy to preallocate the vectors using the size from the previous frame. It would also be nice to avoid having a small vector for each render trask to track dependencies, and instead intern them into a larger vector at the graph level (tasks can refer to their dependencies using a range of indices in the dependency vector).

The majority of render tasks have 0, 1 or 2 dependencies, except for pictures that typically have dozens to hundreds of dependencies. SmallVec with 2 inline elements avoids many tiny heap allocations in pages with a lot of text shadows and other types of render tasks.

Unlike other types of render tasks, pictures can have hundreds of dependencies. The dependency vector is re-built every frame, leading to a lot of vector re-allocations in some pages.

Depends on D60151

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: