Add __spreadArrays helper - #31166
Merged
Merged
Conversation
Contributor
Author
|
TypeScript Bot (@typescript-bot) perf test |
Contributor
|
Heya Ron Buckton (@rbuckton), I've started to run the perf test suite on this PR at 528601f. You can monitor the build here. It should now contribute to this PR's status checks. Update: The results are in! |
Contributor
|
Ron Buckton (@rbuckton) Here they are:Comparison Report - master..31166
System
Hosts
Scenarios
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ron Buckton (rbuckton)
force-pushed
the
spreadArraysES5
branch
from
April 29, 2019 23:45
528601f to
a451953
Compare
Ron Buckton (rbuckton)
marked this pull request as ready for review
April 30, 2019 00:10
|
What about speedup var __spreadArrays = function () {
for (var i = 0, l = 0, al = arguments.length; i < al; ++i)
l += arguments[i].length;
for (var ar = new Array(l), i = 0, k = 0; i < al; ++i)
for (var j = 0, a = arguments[i], jl = a.length; j < jl; ++j, ++k)
ar[k] = a[j];
return ar;
};On V8 7.4 this faster by ~3x-6x for large (> 1k) arrays. |
Adds a
__spreadArrayshelper for a more accurate spread behavior when not using--downlevelIteration.Fixes #8856