Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Math max or ternary operator
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Browser:
Chrome 124
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Math.max
3234802.5 Ops/sec
Ternary and operate again
3179446.2 Ops/sec
Ternary with cache
4553783.0 Ops/sec
Script Preparation code:
var a = 3452; var b = 5672;
Tests:
Math.max
var c = Math.max(a + b, a * b);
Ternary and operate again
var d = a + b > a * b ? a + b : a * b;
Ternary with cache
var e = a + b; var f = a * b; var h = e > f ? e : f;