Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Array.prototype.slice vs Spread (2)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15
Browser:
Safari 18
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Array.prototype.slice
2.7M/s
Spread
2.5M/s
View exact numbers
Test name
Executions per second
✓
Array.prototype.slice
2,694,673 Ops/sec
Spread
2,532,534 Ops/sec
Tests:
Array.prototype.slice
var fooSet = []; for(var i=0;i<100;i++) { fooSet.push(i); } var other = fooSet.slice(0);
Spread
var fooSet = []; for(var i=0;i<100;i++) { fooSet.push(i); } var other = [...fooSet];