Script Preparation code:
Tests:

Historical Performance Data aggregated from 38 community runs

Desktop Results:
Chrome 30 runs
ternary
7.1M/s
Math.max
5.9M/s

Fastest: ternary (1.2x faster)

View exact numbers
  • ternary: 7,138,147 ops/sec
  • Math.max: 5,854,490 ops/sec
Firefox 8 runs
Math.max
612.2M/s
ternary
447.3M/s

Fastest: Math.max (1.4x faster)

View exact numbers
  • Math.max: 612,180,992 ops/sec
  • ternary: 447,344,128 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
    ternary
    Math.max

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:146.0) Gecko/20100101 Firefox/146.0
Firefox 146 on Windows
View result in a separate tab
Math.max
1990.2M/s
ternary
1319.3M/s
View exact numbers
Test name Executions per second
Math.max 1,990,186,624 Ops/sec
ternary 1,319,313,152 Ops/sec