Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Concat vs Prototype Push vs Push Spread vs Spread
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0
Browser:
Firefox 133
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
concat
42K/s
prototype push
34K/s
push spread
34K/s
spread
18K/s
View exact numbers
Test name
Executions per second
✓
concat
42,296 Ops/sec
prototype push
34,232 Ops/sec
push spread
34,187 Ops/sec
spread
18,125 Ops/sec
Tests:
concat
let arr1 = new Array(5000).fill(1234567890); const arr2 = new Array(5000).fill(1234567890); arr1 = arr1.concat(arr2);
prototype push
let arr1 = new Array(5000).fill(1234567890); const arr2 = new Array(5000).fill(1234567890); Array.prototype.push.apply(arr1,arr2);
push spread
let arr1 = new Array(5000).fill(1234567890); const arr2 = new Array(5000).fill(1234567890); arr1.push(...arr2);
spread
let arr1 = new Array(5000).fill(1234567890); const arr2 = new Array(5000).fill(1234567890); arr1 = [...arr1, ...arr2]