Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
LocaleCompare vs My sorting
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser:
Chrome 133
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Locale compare
108543176.0 Ops/sec
My version
5237084.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var string1 = "Lucy Aligtore"; var string2 = "Fridolin Bauer";
Tests:
Locale compare
string1.localeCompare(string2);
My version
const s1 = string1 ? [...string1.toLowerCase()].reduce((prev, char) => prev + char.charCodeAt(0), 0) : 0; const s2 = string2 ? [...string2.toLowerCase()].reduce((prev, char) => prev + char.charCodeAt(0), 0) : 0; string1 && string2 ? Math.sign(s1 - s2) : Math.sign(s2 - s1);