Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Intl.Collator.compare() vs localeCompare()
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0
Browser:
Firefox 130
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Intl.Collator.compare()
13.5M/s
localeCompare()
323K/s
View exact numbers
Test name
Executions per second
✓
Intl.Collator.compare()
13,539,522 Ops/sec
localeCompare()
323,025 Ops/sec
Script Preparation code:
var a = "FOO BAR"; var b = "foo bar"; var options = { sensitivity: 'base' }; var collator = new Intl.Collator(undefined, options);
Tests:
localeCompare()
a.localeCompare(b, undefined, options) === 0
Intl.Collator.compare()
collator.compare(a, b) === 0