ternary vs Math.maxFastest: ternary (1.2x faster)
7,138,147 ops/sec
5,854,490 ops/sec
Fastest: Math.max (1.4x faster)
612,180,992 ops/sec
447,344,128 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| ternary | |
| Math.max |
| Test name | Executions per second |
|---|---|
| ✓ Math.max | 1,990,186,624 Ops/sec |
| ternary | 1,319,313,152 Ops/sec |