Run details:
Mozilla/5.0 (X11; CrOS x86_64 13729.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.130 Safari/537.36
Chrome 89
Chrome OS 13729.84.0
Desktop
3 years ago
Test name Executions per second
Math.min/max 711339.6 Ops/sec
Ternary 1218261.0 Ops/sec
Math.min 1051957.0 Ops/sec
Ternary min 1363332.0 Ops/sec
Math.max 930408.8 Ops/sec
Ternary max 1491835.0 Ops/sec
Script Preparation code:
Tests:
  • Math.min/max

  • Math.min

  • Math.max

  • Ternary clamp

  • Ternary min

  • Ternary max

  • Ternary clamp inlined

  • Ternary min inlined

  • Ternary max inlined