Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
string includes case-insensitively
(version: 1)
Comparing performance of:
includes toLocaleLowerCase vs regexp test case insensitivly
Created:
6 hours ago
by:
Registered User
Jump to the latest result
Script Preparation code:
const values = [ 'a', 'b', 'c', 'Z', 'Y', '1', '2', ]; const hello = 'Hello'.toLocaleLowerCase(); const rello = /Hello/i;
Tests:
includes toLocaleLowerCase
values.some(v => v.toLocaleLowerCase().includes(hello));
regexp test case insensitivly
values.some(v => rello.test(v));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
includes toLocaleLowerCase
regexp test case insensitivly
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 hours ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Browser/OS:
Chrome 148 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
includes toLocaleLowerCase
22431098.0 Ops/sec
regexp test case insensitivly
15370610.0 Ops/sec
Related benchmarks:
Regexp vs includes method
Javascript: Case insensitive string comparison performance
Javascript: Case insensitive string comparison performance lowerLocale
Javascript: Case insensitive string comparison performance 2
Case insensitive string comparison performance
Case insensitive string comparison: toLowerCase vs localeCompare vs toUpperCase
Javascript: Case insensitive exact string comparison
includes + toLocaleLowerCase vs RegExp + i
Javascript: Case insensitive string comparison performance inc. regex
Comments
Confirm delete:
Do you really want to delete benchmark?