Bug 131462

Summary: Spread operator performance in pure array concatenation should be closer to Array.prototype.concat
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: joepeck, mark.lam, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[TEST] Test Case none

Description Joseph Pecoraro 2014-04-09 15:49:47 PDT
Created attachment 228995 [details]
[TEST] Test Case

Comparing the performance of:

    var combined = [...arr1, ...arr2];
    var combined = arr1.concat(arr2);

The concat is faster then the spread. They should be closer in performance considering they produce the same result.

See attached test case.
Comment 1 Joseph Pecoraro 2020-04-09 14:22:05 PDT
Looks like the performance is now even better for the spread case for this test case. So this can probably be closed?
Comment 2 Alexey Proskuryakov 2020-04-10 09:49:43 PDT
I don't see why not!