If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Use a smaller initial size for the srcnotes vector

RESOLVED FIXED in mozilla36

Status

()

Core
JavaScript Engine
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla36
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
BytecodeEmitter has vectors for bytecode and source notes. We want the initial
sizes of these vectors to be large enough that we don't have to do lots of
resizings.

But we don't also want them to be excessively large, because we allocate lots
of them. E.g. ~44,000 when I start the browser and load Gmail, TechCrunch and
CNN.

Currently we use 1024 bytes for the initial size of the bytecode vector, and
98% of the time that is big enough to avoid resizings, which seems reasonable.

We also use 1024 bytes for the initial size of the source notes vector, and
99.7% of the time that is big enough to avoid resizings, which seems a little
high. We can reduce it to 256 bytes and still avoid resizings 99% of the time.
(128 bytes takes us down to about 93%.)

(Note: all these measurements are for non-zero vectors. We also have plenty of
zero-length vectors because the prolog is often empty, but we already handle
that appropriately because we create the vectors lazily.)
(Assignee)

Comment 1

3 years ago
Created attachment 8509321 [details] [diff] [review]
Use a smaller initial size for the srcnotes vector
Attachment #8509321 - Flags: review?(jorendorff)
Attachment #8509321 - Flags: review?(jorendorff) → review+
(Assignee)

Comment 2

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/98d0bbc30817
https://hg.mozilla.org/mozilla-central/rev/98d0bbc30817
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.