Closed Bug 1520645 Opened 5 years ago Closed 5 years ago

Improve vector recycling to avoid heap allocations

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: kvark, Assigned: kvark)

Details

Attachments

(1 file)

The old vector recycler (see recycle_vec) had a few problems:

  1. shrinking to fit would be inevitably followed by re-allocation, since it's unlikely that the consequent sizes are below the immediately followed frames
  2. shrinking before clearing means that the existing contents are copied over, which is a waste
The old vector recycler had a few problems:        
  1. shrinking to fit would be inevitably followed by re-allocation, since it's unlikely that the consequent sizes are below the immediately followed frames
  2. shrinking before clearing means that the existing contents are copied over, which is a waste

The new code has more complicated logic for recycling, aimed at reducing heap allocations. It's also collecting the statistics.
Pushed by dmalyshau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bf95c0c1f962
WR improved vector allocation recycler r=nical
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Assignee: nobody → dmalyshau
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: