Tests:
Math.min/max
Math.min
Math.max
Ternary clamp
Ternary min
Ternary max
Ternary clamp inlined
Ternary min inlined
Ternary max inlined
Results show median performance across all community submissions.
Run this benchmark yourself to verify on your device.
Rendered benchmark preparation results:
Latest run results:
Run details: (Test run date:
3 months ago )
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 Edg/146.0.0.0
Browser/OS:
Chrome 146 on Windows
View result in a separate tab
Embed
Ternary clamp inlined
154.3M/s
Ternary max inlined
152.1M/s
Ternary min inlined
148.2M/s
View exact numbers
Test name
Executions per second
✓
Math.min
159,487,072 Ops/sec
Math.min/max
156,125,312 Ops/sec
Math.max
154,967,248 Ops/sec
Ternary clamp inlined
154,326,384 Ops/sec
Ternary max inlined
152,093,184 Ops/sec
Ternary clamp
151,308,320 Ops/sec
Ternary min
151,137,696 Ops/sec
Ternary min inlined
148,162,432 Ops/sec
Ternary max
146,872,528 Ops/sec
Do you really want to delete benchmark?