Script Preparation code:
AخA
 
this.numberA = Math.random() * 1000;
this.numberB = Math.random() * 1000;
Tests:
  • Math.min

     
    return Math.min(this.numberA, this.numberB);
  • if

     
    if (this.numberA)
      return this.numberA;
    else
      return this.numberB;
  • ternary

     
    return this.numberA ? this.numberA : this.numberB
  • OR

     
    return this.numberA || this.numberB
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Math.min
    if
    ternary
    OR

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Linux; Android 11; SM-A035F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Mobile Safari/537.36
Chrome Mobile 104 on Android
View result in a separate tab
Test name Executions per second
Math.min 1245192.2 Ops/sec
if 409182720.0 Ops/sec
ternary 408747200.0 Ops/sec
OR 407114400.0 Ops/sec