Closed Bug 1609487 Opened 5 years ago Closed 5 years ago

FunctionTree vector growBy is taking almost 1% of profile time in Parse microbenchmark

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: mgaudet, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

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.

Priority: -- → P1

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.

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.

We are going to remove the FunctionTree in Bug 1635976 so hopefully this is resolved by it.

Depends on: 1635976

Matt, can you sanity check this is resolved?

Flags: needinfo?(mgaudet)

Just ran a perf profile: No more interesting stencil related symbols anywhere near the top.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(mgaudet)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: