Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Math.min vs inline comparison
(version: 1)
Comparing performance of:
Math.min vs inline comparison
Created:
one month ago
by:
Guest
Go to the latest result
Script Preparation code:
this.numberA = Math.random() * 1000; this.numberB = Math.random() * 1000; this.numberC = Math.random() * 1000;
Tests:
Math.min
return this.numberC < Math.min(this.numberA, this.numberB);
inline comparison
return (this.numberC < this.numberA && this.numberC < this.numberB);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Math.min
inline comparison
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0
Browser/OS:
Firefox 151 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
inline comparison
3007.6M/s
Math.min
98.0M/s
View exact numbers
Test name
Executions per second
✓
inline comparison
3,007,601,920 Ops/sec
Math.min
98,015,336 Ops/sec
Related benchmarks
Math.min vs if/else vs ternary operator
Math.max vs. if vs. ternary
Math.min vs if/else vs ternary operator for Int
Math.min vs if/else vs ternary operator vs assing first
Math.min vs if/else vs ternary operator test 2
Math.min vs if/else vs ternary operator test 3
Ternary comparison function versus Math.min
Comments
Confirm delete:
Do you really want to delete benchmark?