Closed Bug 1611176 Opened 5 years ago Closed 5 years ago

Expensive moves of RenderTask into the tasks vector

Categories

(Core :: Graphics: WebRender, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: nical, Assigned: nical)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We get a non-trivial amount of time spent in memmove when pushing render tasks into the render graph (5% of total frame building time on a test case with a large amount of text shadows).

We can work around this using the VecHelper trick add().init(value) which performs the potential reallocation before initializing the value.

On pages with many render tasks (typically a lot of text shadows), we spend a lot of time moving RenderTask which is a fairly large struct into the render graph's buffer. This patch avoids it by using the VecHelper trick of allocaitng space before initializing the value. Some RenderTask::new_* methods which take the render task graph in parameter were modified to add the task and return the task ID to work around borrow-checking restriction.

Assignee: nobody → nical.bugzilla
Status: NEW → ASSIGNED
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e30053699db0 Avoid expensive memmoves when adding render tasks. r=gw
Status: ASSIGNED → RESOLVED
Closed: 5 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: