Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
speed test: concat vs spread vs 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/122.0.0.0 Safari/537.36
Browser:
Chrome 122
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
concat
17000994.0 Ops/sec
push
34585948.0 Ops/sec
spread
34870324.0 Ops/sec
Tests:
concat
var array1 = ["dog", "cat", "red", "blue", "yellow", "one", "two" ]; var array2 = ["bird", "snake", "green", "brown", "black", "three", "four" ]; array1.concat(array2);
push
var array1 = ["dog", "cat", "red", "blue", "yellow", "one", "two" ]; var array2 = ["bird", "snake", "green", "brown", "black", "three", "four" ]; array2.map(el => array1.push(el));
spread
var array1 = ["dog", "cat", "red", "blue", "yellow", "one", "two" ]; var array2 = ["bird", "snake", "green", "brown", "black", "three", "four" ]; array1 = [...array1, ...array2];