Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Reduce: Spread vs push
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; arm_64; Android 13; Air1 Ultra+) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.6834.122 YaBrowser/25.2.4.122.00 SA/3 Mobile Safari/537.36
Browser:
Yandex Browser 25
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Push
16.6M/s
Spread
4.4M/s
View exact numbers
Test name
Executions per second
✓
Push
16,585,179 Ops/sec
Spread
4,410,115 Ops/sec
Script Preparation code:
var sut = [{ foo1: 'bar1' }, { foo2: 'bar2' }, { foo3: 'bar3' }];
Tests:
Spread
sut.reduce((acc, x) => [...acc, x], [])
Push
sut.reduce((acc, x) => { acc.push(x); return acc; }, [])