Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
RegEx.matchAll vs. String.indexOf vs. String.match
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/109.0.0.0 Safari/537.36
Browser:
Chrome 109
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
RegEx.matchAll
2161896.0 Ops/sec
String.indexOf
3576807.2 Ops/sec
String.match
1348894.4 Ops/sec
Script Preparation code:
var string = "Hello world!"; var regex = /Hello|world/g;
Tests:
RegEx.matchAll
string.matchAll(regex);
String.indexOf
string.indexOf("Hello"); string.indexOf("world");
String.match
string.match("Hello"); string.match("wello");