Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Get max from an array of numbers (Math.max vs. iteration) V3
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 138
Operating system:
Android
Device Platform:
Mobile
Date tested:
10 months ago
Test name
Executions per second
Math.max
935038.9 Ops/sec
Reduce
1453377.6 Ops/sec
Script Preparation code:
var arr = [...Array(500)].map(() => Math.floor(Math.random() * 100000));
Tests:
Math.max
return Math.max(...arr);
Reduce
return arr.reduce((maxi, curr) => maxi < curr ? curr : maxi, -1);