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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Browser:
Chrome 127
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
toLowerCase()
14.0M/s
toLowerCase() FAIL
12.4M/s
localeCompare()
295K/s
localeCompare() FAIL
281K/s
View exact numbers
Test name
Executions per second
✓
toLowerCase()
14,030,019 Ops/sec
toLowerCase() FAIL
12,447,962 Ops/sec
localeCompare()
295,344 Ops/sec
localeCompare() FAIL
281,424 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)