Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Javascript: Case insensitive string comparison performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0
Browser:
Firefox 137
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
toLowerCase()
1867.6M/s
toLowerCase() FAIL
1403.7M/s
localeCompare() FAIL
346K/s
localeCompare()
310K/s
View exact numbers
Test name
Executions per second
✓
toLowerCase()
1,867,623,680 Ops/sec
toLowerCase() FAIL
1,403,733,504 Ops/sec
localeCompare() FAIL
346,000 Ops/sec
localeCompare()
310,187 Ops/sec
Script Preparation code:
var a = "John Doe" var b = "john doe" var c = "john smith" var o = { sensitivity: 'base' }
Tests:
toLowerCase()
a.toLowerCase() === b.toLowerCase()
localeCompare()
a.localeCompare(b,undefined,o)
toLowerCase() FAIL
c.toLowerCase() === b.toLowerCase()
localeCompare() FAIL
c.localeCompare(b,undefined,o)