Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Large Array: concat vs spread vs push
Compares the three mechanisms for combining arrays with 1k arrays
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/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Concat
5518470.5 Ops/sec
Spread
334098.1 Ops/sec
Push
631095.8 Ops/sec
Script Preparation code:
var arr1 = Array.from(Array(1000).keys());
Tests:
Concat
var arr = []; arr = arr.concat(arr1);
Spread
var arr = []; arr = [...arr, ...arr1];
Push
var arr = []; arr.push(...arr1);