Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
array spread vs concat vs from vs slice
Compare various ways of copying an array
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser:
Chrome 133
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Array.prototype.slice
107.0M/s
Array.prototype.concat
78.5M/s
spread operator
74.0M/s
Array.prototype.from
66.8M/s
View exact numbers
Test name
Executions per second
✓
Array.prototype.slice
106,993,408 Ops/sec
Array.prototype.concat
78,491,616 Ops/sec
spread operator
74,008,480 Ops/sec
Array.prototype.from
66,798,720 Ops/sec
Tests:
Array.prototype.concat
const array = [1, 2] const newArray = array.concat()
Array.prototype.from
const array = [1, 2] const newArray = Array.from(array)
Array.prototype.slice
const array = [1, 2] const newArray = array.slice(0)
spread operator
const array = [1, 2] const newArray = [...array]