Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Push vs LHS spread
Is it fast to build up an array using the spread operator on the left-hand side?
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/148.0.0.0 Safari/537.36
Browser:
Chrome 148
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one month ago
Push
6.0M/s
Spread
217K/s
View exact numbers
Test name
Executions per second
✓
Push
5,964,802 Ops/sec
Spread
216,824 Ops/sec
Tests:
Push
const arr = []; for (let i=0; i < 100; i++) { arr.push(i); }
Spread
let arr = []; for (let i=0; i < 100; i++) { arr = [...arr, i]; }