Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.prototype.slice vs spread operator on a bigger array with bigger elements
(version: 1)
Compare the new ES6 spread operator with the traditional slice() method on a bigger array.
Comparing performance of:
Array.prototype.slice vs spread operator
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var array = Array(10000).fill(Array(10000000).fill({ rand: Math.random(), randStr: 'str' + Math.random() }))
Tests:
Array.prototype.slice
var otherArray = array.slice();
spread operator
var otherArray = [...array];
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.prototype.slice
spread operator
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser/OS:
Chrome 130 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.prototype.slice
1315581.9 Ops/sec
spread operator
124964.0 Ops/sec
Related benchmarks:
Array.prototype.slice(0) vs spread operator
Array.prototype.slice vs spread operator.
Array.prototype.slice vs spread operator with length limit
Array.prototype.slice vs spread operator for number only array
Array.prototype.slice vs spread operator With slightly bigger array
Array.prototype.slice vs spread operator on a bigger array
Array.prototype.slice vs spread operator - large array 100000
Array.prototype.slice vs spread operator performance
Array.prototype.slice vs spread operator - large array 10000000
Comments
Confirm delete:
Do you really want to delete benchmark?