Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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
Benchmark engine:
Benchmark.js
spread
34.9M/s
push
34.6M/s
concat
17.0M/s
View exact numbers
Test name
Executions per second
✓
spread
34,870,324 Ops/sec
push
34,585,948 Ops/sec
concat
17,000,994 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];