Closed Bug 1512042 Opened 6 years ago Closed 5 years ago

Consider using SegmentedVector for gray root buffers

Categories

(Core :: JavaScript: GC, enhancement, P3)

61 Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(1 file)

The comments in SegmentedVector.h say:

// This class should be used in preference to mozilla::Vector or nsTArray when
// you are simply gathering items in order to later iterate over them.
//
// - In the case where you don't know the final size in advance, using
//   SegmentedVector avoids the need to repeatedly allocate increasingly large
//   buffers and copy the data into them.

This applies to our grey root buffers (Zone::gcGrayRoots_) where we gather a potentially large number of Cell pointers in the first slice of the GC so we can mark them later on.  It would be good to avoid the reallocation and copying involved with using a Vector here.

Also I'm curious what effect a different implementation would have on crashes like bug 1203273.

Patch to use SegmentedVectors for the gray root buffers.

We can see if this makes any difference to the telemetry and back it out if it makes things worse.

Assignee: nobody → jcoppeard
Attachment #9037540 - Flags: review?(pbone)
Comment on attachment 9037540 [details] [diff] [review]
bug1512042-gray-buffer-vector

Review of attachment 9037540 [details] [diff] [review]:
-----------------------------------------------------------------

The patch itself LGTM, but since today we're now in soft freeze.  Unless you have a strong reason to land it now (I don't know about Bug 1203273)
then maybe wait until next week.
Attachment #9037540 - Flags: review?(pbone) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4ac26510b88f
Try using SegmentedVector for gray root buffers r=pbone
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/231f059ad9d9
Fix bustage on MacOS X r=me on a CLOSED TREE
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: