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 693489.2 Ops/sec
Ternary 1179710.0 Ops/sec
Math.min 1169594.0 Ops/sec
Ternary min 1495769.0 Ops/sec
Math.max 1289346.0 Ops/sec
Ternary max 1753329.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