Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
RegEx.test vs. String.includes vs. String.match 2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
RegEx.test
17907860.0 Ops/sec
String.includes
9542286.0 Ops/sec
String.match
1334912.6 Ops/sec
Script Preparation code:
var string = "/api/cms-content/v1/web/footer?foo=bas /api/cms-content/v1/mobile/footer?foo=bas"; var regex = /\/api\/cms-content\/v1\/web\/*|\/api\/cms-content\/v1\/mobile\/*/g;
Tests:
RegEx.test
regex.test(string);
String.includes
string.includes("/api/cms-content/v1/mobile") && string.includes("/api/cms-content/v1/web");
String.match
string.match("/api/cms-content/v1/mobile") && string.match("/api/cms-content/v1/web");