Add LifoAlloc to CompilationStencil
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
People
(Reporter: tcampbell, Assigned: tcampbell)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Attachments
(7 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Since the ParserAtomsTable keeps all its atoms alive until it is destroyed, it is a great candidate for LifoAlloc
. This should improve performance of it, and later we can use a LifoAlloc for the CompilationStencil itself.
Assignee | ||
Comment 1•4 years ago
|
||
The lifetime of the ParserAtomEntries in the ParserAtomTable is the same as
the ParserAtomsTable. Use a LifoAlloc to speed up allocation and destruction.
Assignee | ||
Comment 2•4 years ago
|
||
I'm expanding scope of this bug to include putting the LifoAlloc directly in the CompilationStencil.
Assignee | ||
Comment 3•4 years ago
|
||
Later patches will use this to move allocations here to speed up cleanup of
stencils.
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
To speed up cleanup of CompilationStencil, we now use the LifoAlloc to hold
the GC things. The frontend accumulates items on the stack before passing the
complete set to the LifoAlloc. This avoids the unique allocations introduced
by the stencil work and is generally better all around. We also use stack
reservation to cover most gcThings lists without ever allocating.
Depends on D95296
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/656da7d03e9f Add LifoAlloc to CompilationStencil. r=arai https://hg.mozilla.org/integration/autoland/rev/360ff991b0d3 Store ParserAtomEntry in CompilationStencil::alloc. r=arai
Comment 6•4 years ago
|
||
bugherder |
Comment 7•4 years ago
|
||
After the above all patches, the score for bug 1674306 bench (with XDR files fixed to follow updated structure), with stencil-mvp, improves from 14165 to 12319, that's 13% improvement.
the score for without-stencil-mvp also improves from 7106 to 6692,
and stencil-mvp is 84% regression from without-stencil-mvp.
I'll check bug 1674351 patch shortly.
Assignee | ||
Comment 8•4 years ago
|
||
TODO: Apply same approach to ScopeStencil::data
, BigIntStencil::buf
, and RegExprStencil::buf
.
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/00186be8038a Use LifoAlloc for ScriptStencil gcThings list. r=arai
Comment 10•4 years ago
|
||
bugherder |
Assignee | ||
Comment 11•4 years ago
|
||
The StencilXDR interface has access to internals of ScopeStencil so having
accessing to the explicit methods is helpful. This also uses the stencil as
the argument instead of a UniquePtr& which makes it easier to change types
later.
Assignee | ||
Comment 12•4 years ago
|
||
Instead of allocating temporary ParserScopeData on the JSContext's temporary
LifoAlloc, we use the Stencil's LifoAlloc. Will will allow using this
allocation directly in the stencil in future.
Depends on D95941
Assignee | ||
Comment 13•4 years ago
|
||
Have the ScopeStencil data be owned by the Stencil LifoAlloc. This reduces
cleanup costs for the stencil. Also directly re-use the allocation from the
frontend and removing the extra copies (and code that does the copy).
Depends on D95942
Assignee | ||
Comment 14•4 years ago
|
||
Instead of using a UniqueTwoByteChars for the strings, switch to using a
ParserAtom. This simplifies code, and makes stencil smaller. Instantiating a
RegExpStencil has to generate a JSAtom already, so this is sensible.
Depends on D95943
Comment 15•4 years ago
|
||
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6a8ab1e6c7b2 Move XDRParser*ScopeData methods to StencilXDR interface. r=arai https://hg.mozilla.org/integration/autoland/rev/19fe77d2b578 Use the Stencil's LifoAlloc for ParserScopeData in frontend. r=arai https://hg.mozilla.org/integration/autoland/rev/5592ca1320c4 Use LifoAlloc for Stencil ParserScopeData. r=arai
Comment 16•4 years ago
|
||
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c6b2d17bda5f Use ParserAtom for RegExpStencil. r=arai
Comment 17•4 years ago
|
||
bugherder |
Assignee | ||
Comment 18•4 years ago
|
||
I'll close this bug off now. The BigIntStencil probably could be converted too, but first we should see what happens with ScriptThingVariant
. The BigInts will turn into just a ParserAtom, but will need a special tag still so we instantiate correctly.
Comment 19•4 years ago
|
||
== Change summary for alert #27539 (as of Fri, 06 Nov 2020 08:01:52 GMT) ==
Improvements:
Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|---|
4% | facebook-redesign | fcp | linux64-shippable-qr | warm webrender | 399.67 -> 383.00 |
4% | facebook-redesign | fcp | linux64-shippable-qr | warm webrender | 399.15 -> 383.00 |
4% | facebook-redesign | fcp | linux64-shippable | warm | 399.62 -> 383.67 |
3% | loadtime | linux64-shippable | warm | 1,047.08 -> 1,012.92 | |
3% | loadtime | linux64-shippable-qr | warm webrender | 1,046.88 -> 1,015.67 | |
2% | SpeedIndex | android-hw-g5-7-0-arm7-api-16-shippable | warm | 2,415.08 -> 2,358.17 | |
2% | loadtime | android-hw-g5-7-0-arm7-api-16-shippable | warm | 2,544.52 -> 2,485.75 | |
2% | facebook-redesign | linux64-shippable-qr | warm webrender | 315.75 -> 308.54 | |
2% | facebook-redesign | loadtime | linux64-shippable-qr | warm webrender | 438.15 -> 428.83 |
2% | facebook-redesign | loadtime | linux64-shippable | warm | 437.38 -> 428.12 |
2% | facebook-redesign | linux64-shippable | warm | 315.22 -> 308.61 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=27539
Description
•