Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Math.max + Math.min and reduce
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/143.0.0.0 Safari/537.36
Browser:
Chrome 143
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
3 months ago
Test name
Executions per second
2 Reducers
83.2 Ops/sec
1 Reducer
140.3 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var data = Array.from({ length: 1000000 }, (_, i) => i)
Tests:
2 Reducers
const max = data.reduce( (m, x) => x > m ? x : m, -Infinity ); const min = data.reduce( (m, x) => x < m ? x : m, Infinity );
1 Reducer
data.reduce( ({ min, max }, value) => ({ max: Math.max(max, value), min: Math.min(min, value), }), { min: Infinity, max: -Infinity }, );