Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Javascript: Case insensitive string comparison performance with indexOf 2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser:
Chrome 143
Operating system:
Linux
Device Platform:
Desktop
Date tested:
8 months ago
Benchmark engine:
Benchmark.js
toLowerCase()
90.1M/s
localeCompare()
278K/s
View exact numbers
Test name
Executions per second
✓
toLowerCase()
90,057,728 Ops/sec
localeCompare()
277,925 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().indexOf(b.toLowerCase()) !== -1
localeCompare()
a.localeCompare(b,undefined,o)