Open Bug 1821108 Opened 1 year ago Updated 11 months ago

EmberJS-TodoMVC spends a lot more time in removeListenerFrom doing array splicing than in V8

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

People

(Reporter: mstange, Unassigned)

References

(Blocks 1 open bug)

Details

In the function removeFromListener in the EmberJS-TodoMVC benchmark, we spend 3080 samples inside Array.prototype.splice versus V8's 739 samples.

To reproduce, run index.js inside https://github.com/mozilla/Speedometer/tree/ab0e3b8406bbc0356244f8cd430900e9a346737b/resources/todomvc/architecture-examples/emberjs/dist in the JS shell.

Profiles (focused on removeFromListener's "JS-only self time"):
Spidermonkey: https://share.firefox.dev/3mGyBXK
V8: https://share.firefox.dev/3ylHwR0

splice is a very complicated builtin. We probably want to carve out some fast paths with CacheIR based on the number of arguments, for example I think this is called with two arguments and the return value is unused, so we should be able to use a faster VM function for that case.

I've updated the V8 profile link (the previous one had incorrect data because we hadn't turned off inlining) and now the numbers are 2080 vs 739.

Blocks: 1801194
Type: defect → task
Priority: -- → P2

EmberJS has been removed from sp3. Does the issue show up in other tests?

Flags: needinfo?(mstange.moz)

I have not seen Array.prototype.splice show up majorly in profiles of the other sp3 subtests.

No longer blocks: speedometer3
Flags: needinfo?(mstange.moz)
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.