Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array concat vs spread operator vs push with large arrays
Compare the new ES6 spread operator with the traditional concat() method and push
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Browser:
Chrome 120
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Array.prototype.concat
455.5 Ops/sec
spread operator
265.0 Ops/sec
Push
319.8 Ops/sec
Tests:
Array.prototype.concat
let a = new Array(500000).fill(0); let b = new Array(10000).fill(0); var other = a.concat(b);
spread operator
let a = new Array(500000).fill(0); let b = new Array(10000).fill(0); var other = [ ...a, ...b ]
Push
let a = new Array(500000).fill(0); let b = new Array(10000).fill(0); var other = a.push(...b);