Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
RegEx.test vs. String.includes vs. String.match vs String.includes (using ||) (with multiple strings)
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/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
RegEx.test
36688956.0 Ops/sec
Iteration and String.includes
6574237.5 Ops/sec
String.match
23977752.0 Ops/sec
String.includes (using ||)
6554134.0 Ops/sec
Script Preparation code:
const string = 'Outstanding'; const regex = /toda|bfi|coms|cot|cos|ipe|ips|rn|rm|ap|sf|st|sp|ss|sv|to|t|o|e|s/; const searchStrings = ['toda', 'bfi', 'coms', 'cot', 'cos', 'ipe', 'ips', 'rn', 'rm', 'ap', 'sf', 'st', 'sp', 'ss', 'sv', 'to', 't', 'o', 'e', 's'];
Tests:
RegEx.test
/toda|bfi|coms|cot|cos|ipe|ips|rn|rm|ap|sf|st|sp|ss|sv|to|t|o|e|s/.test('Outstanding');
Iteration and String.includes
['toda', 'bfi', 'coms', 'cot', 'cos', 'ipe', 'ips', 'rn', 'rm', 'ap', 'sf', 'st', 'sp', 'ss', 'sv', 'to', 't', 'o', 'e', 's'].some(s => 'Outstanding'.includes(s));
String.match
'Outstanding'.match(/toda|bfi|coms|cot|cos|ipe|ips|rn|rm|ap|sf|st|sp|ss|sv|to|t|o|e|s/);
String.includes (using ||)
'Outstanding'.includes('toda') || 'Outstanding'.includes('bfi') || 'Outstanding'.includes('coms') || 'Outstanding'.includes('cot') || 'Outstanding'.includes('cos') || 'Outstanding'.includes('ipe') || 'Outstanding'.includes('ips') || 'Outstanding'.includes('rn') || 'Outstanding'.includes('rm') || 'Outstanding'.includes('ap') || 'Outstanding'.includes('sf') || 'Outstanding'.includes('st') || 'Outstanding'.includes('sp') || 'Outstanding'.includes('ss') || 'Outstanding'.includes('sv') || 'Outstanding'.includes('to') || 'Outstanding'.includes('t') || 'Outstanding'.includes('o') || 'Outstanding'.includes('e') || 'Outstanding'.includes('s');