Improve performance of [...obj] and Array.from
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: bzbarsky, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
2.24 KB,
text/html
|
Details |
See attached testcase. slice.call() is way faster than the more idiomatic things. Two issues here: 1) slice.call() does not need to do all the iterator jazz. 2) slice has a fast path for nodelists where it only calls a single proxy hook and has it fill in the list. It'd be nice if we could improve both of those for Array.from and destructuring...
Comment 1•10 years ago
|
||
There may be relevant lessons in bug 904723, which was something of a slog. The first step should be to measure improvement due to nbp's work on escape analysis and alias anlysis (see bug 927548 "scalar replacement").
Reporter | ||
Updated•9 years ago
|
Comment 2•7 years ago
|
||
Firefox 53.0.3 Time to slice live nodelist: 0.411ms Time to destructure live nodelist: 0.268ms Time to Array.from live nodelist: 0.562ms Time to slice static nodelist: 0.3955ms Time to destructure static nodelist: 0.248ms Time to Array.from static nodelist: 0.5525ms Time to slice array: 0.0215ms Time to destructure array: 0.107ms Time to Array.from array: 0.3455ms Nightly 55 (23-05-2017) Time to slice live nodelist: 0.417ms Time to destructure live nodelist: 0.216ms Time to Array.from live nodelist: 0.214ms Time to slice static nodelist: 0.38ms Time to destructure static nodelist: 0.197ms Time to Array.from static nodelist: 0.1835ms Time to slice array: 0.021ms Time to destructure array: 0.069ms Time to Array.from array: 0.055ms Improvement from bug 1366372?
Updated•2 years ago
|
Comment 3•15 days ago
|
||
Nightly:
Time to slice live nodelist: 0.015ms
Time to destructure live nodelist: 0.0385ms
Time to Array.from live nodelist: 0.0375ms
Time to slice static nodelist: 0.013ms
Time to destructure static nodelist: 0.0365ms
Time to Array.from static nodelist: 0.0425ms
Time to slice array: 0.0005ms
Time to destructure array: 0.007ms
Time to Array.from array: 0.0065ms
Chrome:
Time to slice live nodelist: 0.106ms
Time to destructure live nodelist: 0.1345ms
Time to Array.from live nodelist: 0.133ms
Time to slice static nodelist: 0.1265ms
Time to destructure static nodelist: 0.127ms
Time to Array.from static nodelist: 0.124ms
Time to slice array: 0ms
Time to destructure array: 0.0005ms
Time to Array.from array: 0ms
We are faster in almost all the cases. Calling this fixed.
Description
•