Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Math.min vs Array.reduce
(version: 1)
Comparing performance of:
Math.min vs Array.reduce
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var data = []; for (var i = 0; i < 1000; ++i) data.push(Math.random());
Tests:
Math.min
Math.min(...data);
Array.reduce
data.reduce((min, cur) => min > cur ? cur : min, data[0]);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Math.min
Array.reduce
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15
Browser/OS:
Safari 18 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Math.min
451581.5 Ops/sec
Array.reduce
232595.6 Ops/sec
Related benchmarks:
Math.max() vs Array.reduce()
Math.max() vs Array.reduce.apply()
Math.min() vs Array.reduce()
Math.max() vs Array.reduce() 4
Math.max() vs Array.reduce() xxx
Math.max() vs Array.reduce() xxxyyy
Math.max.apply() vs Array.reduce()
at(-1) vs (length - 1)
Math.min and Math.max vs reduce vs apply
Comments
Confirm delete:
Do you really want to delete benchmark?