Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.sort vs Math.min+Math.max
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 126
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Array.sort
2531444.5 Ops/sec
Math min and max
1174362.1 Ops/sec
Script Preparation code:
var v1 = 12345678.12345; var v2 = 23456789.01234; var arr = [v2, v1]
Tests:
Array.sort
var a = arr.sort(); var min = a[0]; var max = a[1];
Math min and max
var min = Math.min(v2, v1); var max = Math.max(v2, v1);