Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Regex evaluation
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/130.0.0.0 Safari/537.36 Edg/130.0.0.0
Browser:
Chrome 130
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Regex
3481533.5 Ops/sec
Substring
1689711.0 Ops/sec
Full Regex
3140717.2 Ops/sec
Script Preparation code:
var matchDirective = /webapp-v-([a-z-]+)(?::([a-zA-Z_.-]+))?/, fullDirective = /webapp-v-([a-z-]+)(?::([a-zA-Z_-]+)(?:\.([a-zA-Z_-]+))?)?/, attrName = "webapp-v-bind:class.ifdefined";
Tests:
Regex
var directivematch = matchDirective.exec(attrName), directivename = directivematch[1], directivopts = directivematch[2], pos = directivopts.indexOf("."), attrname = directivopts.substring(0, pos), buildIn = directivopts.substring(pos+1);
Substring
var directivematch = matchDirective.exec(attrName), pos = attrName.indexOf(":"), directivename = attrName.substring(0, pos), directivopts = attrName.substring(pos+1), posbuild = directivopts.indexOf("."), attrname = directivopts.substring(0, posbuild), buildIn = directivopts.substring(posbuild+1);
Full Regex
var directivematch = fullDirective.exec(attrName), directivename = directivematch[1], attrname = directivematch[2], buildIn = directivematch[3];