Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Math.min and Math.max vs reduce vs apply
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Math.min
18996.3 Ops/sec
Array.reduce min
9310.9 Ops/sec
Math.min.apply
298572.6 Ops/sec
Math.max
18437.1 Ops/sec
Array.reduce max
9463.4 Ops/sec
Math.max.apply
253943.4 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var data = []; for (var i = 0; i < 10000; ++i) data.push(Math.random());
Tests:
Math.min
Math.min(...data);
Array.reduce min
data.reduce((min, cur) => min > cur ? cur : min, data[0]);
Math.min.apply
Math.min.apply(Math, data)
Math.max
Math.max(...data);
Array.reduce max
data.reduce((max, cur) => max < cur ? cur : max, data[0]);
Math.max.apply
Math.max.apply(Math, data)