Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Ignore case regex pattern test vs string includes vs new regex test
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/147.0.0.0 Safari/537.36
Browser:
Chrome 147
Operating system:
Windows
Device Platform:
Desktop
Date tested:
4 months ago
Benchmark engine:
Benchmark.js
includes
4.0M/s
regex
2.1M/s
new regex
2.1M/s
string match regex
2.1M/s
string match new regex
2.0M/s
View exact numbers
Test name
Executions per second
✓
includes
4,041,838 Ops/sec
regex
2,127,967 Ops/sec
new regex
2,125,216 Ops/sec
string match regex
2,073,547 Ops/sec
string match new regex
2,048,224 Ops/sec
Script Preparation code:
var string = "Helaas11111111111111111111111111111111111111111111111111111heljhell222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222333333333333343565555ghgfrdfdfdsfshellasdflasdkfjksadfksdflsdfjsdjlfjsdfkjadsfjakdsjfjsadlfklksdjflkjsdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddklllllllllllllllllllllllkkkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhdfgafsdfsfdsadfsadfsadsadgfdgaesssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssHello world!"; var regex = /Hello/i; var newRegex = new RegExp('Hello', 'i');
Tests:
regex
regex.test(string);
includes
string.toLocaleLowerCase().includes("Hello".toLocaleLowerCase());
new regex
newRegex.test(string);
string match regex
string.match(regex);
string match new regex
string.match(newRegex);