Improve vector recycling to avoid heap allocations

RESOLVED FIXED in Firefox 66

Status

()

enhancement
RESOLVED FIXED
5 months ago
5 months ago

People

(Reporter: kvark, Assigned: kvark)

Tracking

unspecified
mozilla66
Points:
---

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

5 months ago

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
Assignee

Comment 1

5 months ago
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.

Comment 2

5 months ago
Pushed by dmalyshau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bf95c0c1f962
WR improved vector allocation recycler r=nical

Comment 3

5 months ago
bugherder
Status: NEW → RESOLVED
Closed: 5 months 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.