Closed Bug 1671887 Opened 1 year ago Closed 1 year ago

Reserve CompilationAtomCache.atoms before instantiation

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

growStorageBy for CompilationAtomCache.atoms takes some amount of time while instantiation.
the maximum storage size is known (not-well-known-nor-short atoms in ParserAtomsTable).
so we can reserve the vector, especially off main thread, to shorten the time taken by instantiation on main thread.

Blocks: 1671895
No longer blocks: stencil-mvp

parserAtoms.entrySet_.count() isn't appropriate size to reserve, given that it includes atoms inside lazy functions.
maybe we can add another pass to off-thread task to count atoms that will be converted to JSAtoms

This adds ParserAtoms now has marked_ field, and preparation step for
stencil instantiation.

At this point, the prepration step is optional, and it's performed only on
off-thread task, to perform part of instantiation off main thread.

In the preparation step, all atoms that will be used while instantiation will
be marked, and CompilationAtomCache.atoms is reserved with the number of marked
atoms.

Bug 1672105 will utilize the field and the preparation step to centralize atom
instantiation.

Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/05e5b27f6a60
Reserve CompilationAtomCache.atoms before instantiation. r=tcampbell
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.