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 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 17
Operating system:
iOS 17.5.1
Device Platform:
Mobile
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
toLowerCase() FAIL
16.4M/s
toLowerCase()
13.7M/s
localeCompare()
230K/s
localeCompare() FAIL
228K/s
View exact numbers
Test name
Executions per second
✓
toLowerCase() FAIL
16,375,839 Ops/sec
toLowerCase()
13,662,014 Ops/sec
localeCompare()
230,383 Ops/sec
localeCompare() FAIL
227,758 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)