Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
RegEx.test vs. String.includes vs. String.match (with multiple strings)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
Browser:
Firefox 145
Operating system:
Windows
Device Platform:
Desktop
Date tested:
5 months ago
Test name
Executions per second
RegEx.test
87309048.0 Ops/sec
Iteration and String.includes
7782907.5 Ops/sec
String.match
50932684.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/);