Script Preparation code:
Tests:

Historical Performance Data aggregated from 140 community runs

Desktop Results:
Chrome 94 runs
if
35.2M/s
ternary
34.9M/s
Math.min
15.5M/s

Fastest: if (2.3x faster)

View exact numbers
  • if: 35,192,912 ops/sec
  • ternary: 34,885,328 ops/sec
  • Math.min: 15,531,130 ops/sec
Firefox 31 runs
ternary
607.3M/s
if
534.4M/s
Math.min
41.0M/s

Fastest: ternary (14.8x faster)

View exact numbers
  • ternary: 607,271,296 ops/sec
  • if: 534,361,760 ops/sec
  • Math.min: 40,991,072 ops/sec
Safari 5 runs
if
311.1M/s
ternary
301.6M/s
Math.min
11.8M/s

Fastest: if (26.4x faster)

View exact numbers
  • if: 311,096,032 ops/sec
  • ternary: 301,649,440 ops/sec
  • Math.min: 11,783,476 ops/sec
Mobile Results:
Chrome 10 runs
ternary
16.3M/s
if
15.9M/s
Math.min
9.3M/s

Fastest: ternary (1.7x faster)

View exact numbers
  • ternary: 16,257,832 ops/sec
  • if: 15,901,036 ops/sec
  • Math.min: 9,300,313 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Math.min
    if
    ternary

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Firefox 148 on Windows
View result in a separate tab
ternary
741.1M/s
if
270.8M/s
Math.min
62.2M/s
View exact numbers
Test name Executions per second
ternary 741,108,416 Ops/sec
if 270,818,560 Ops/sec
Math.min 62,191,564 Ops/sec