FunctionTree vector growBy is taking almost 1% of profile time in Parse microbenchmark
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
People
(Reporter: mgaudet, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
908 bytes,
patch
|
Details | Diff | Splinter Review | |
19.45 KB,
image/png
|
Details |
Using this patch by nbp, as well as his fork of the real-js-samples repo and experimentation code, perf
profiling a shell build shows 0.89% of execution time inside of mozilla::Vector<js::frontend::FunctionTree, 0ul, js::TempAllocPolicy>::growStorageBy
There's an opportunity to improve this (at a memory cost) by providing a non-zero MinInlineCapacity.
Updated•5 years ago
|
Reporter | ||
Comment 1•5 years ago
|
||
Reporter | ||
Comment 2•5 years ago
|
||
Reporter | ||
Comment 3•5 years ago
|
||
I just did a quick experiment to get a feel empirically what would be a good MinInlineCapacity
for FunctionTree by dumping the number of children using Yoric+nbp's benchmarking system. The patch and results are attached. Note the log-10 Y axis scale.
As expected, the number of leaf FunctionTreeNodes is dramatically higher than any other count. We could still make the argument that a non-zero MinInlineCapacity
makes sense, but as expected it may come with a memory tradeoff.
Next I'll experiment with performance.
Reporter | ||
Comment 4•5 years ago
|
||
Ah -- funny story. We can't use MinInlineCapacity
here because the Vector definition is within FunctionTree itself, and if you have a non-zero MinInlineCapacity
, then Vector<T>
needs sizeof(T)
, which isn't a complete type at that point.
LinkedList
from mftb isn't a drop-in replacement either.
For giggles I tried std::list
(not shippable due to OOM behaviour): Found no performance change.
Comment 5•5 years ago
|
||
We are going to remove the FunctionTree
in Bug 1635976 so hopefully this is resolved by it.
Reporter | ||
Comment 7•5 years ago
|
||
Just ran a perf profile: No more interesting stencil related symbols anywhere near the top.
Description
•