Bug 131462 - Spread operator performance in pure array concatenation should be closer to Array.prototype.concat
Summary: Spread operator performance in pure array concatenation should be closer to A...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-09 15:49 PDT by Joseph Pecoraro
Modified: 2020-04-10 09:49 PDT (History)
3 users (show)

See Also:


Attachments
[TEST] Test Case (1.89 KB, text/html)
2014-04-09 15:49 PDT, Joseph Pecoraro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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!