Closed Bug 1689161 Opened 3 years ago Closed 3 years ago

Revisit default vector sizes in CompilationState

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The vectors in js::frontend::CompilationState currently have no default capacity. Since we always copy to LifoAlloc at the end, and the state is on stack, it is a good opportunity to use default capacities.

We should be able to dump stats at the end of each compilation (probably biased by delazification). Then we can look at distribution of those stats and pick some thresholds.

This stencil is stack allocated, so reserving a small number of inline vector
elements can avoid allocations in most cases. The chosen values favour
delazifcation scenarios which are by far the most common source of stencil.
Every compilation has at least one scope+script and 80% of delazifications
only have one of each. GCThings are more distributed, but 8 covers 75% of
cases over some very large scripts on common websites. These reservations add
approximately 80 bytes to the stack frame.

Assignee: nobody → tcampbell
Status: NEW → ASSIGNED
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4b85126c68da
Reserve default vector size in ExtensibleCompilationStencil. r=arai
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: