Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
test with/without regex
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Browser:
Chrome 127
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
with regexp
2050688.9 Ops/sec
without regexp
2322037.8 Ops/sec
empty
80378472.0 Ops/sec
Tests:
with regexp
function getDisplayName(definitionName) { const bundleId = getBundleId(definitionName); return name.substring(name.lastIndexOf(':') + 1); } function getBundleId(definitionName) { const matches = definitionName.match(/(.+):/); return (matches && matches.pop()) || ''; } const res = getDisplayName('foo:bar');
without regexp
function getDisplayName(definitionName) { const bundleId = getBundleId(definitionName); return name.substring(name.lastIndexOf(':') + 1); } function getBundleId(definitionName) { const matches = definitionName.split(':'); return matches[0]|| ''; } const res = getDisplayName('foo:bar');
empty
function getDisplayName(definitionName) { const bundleId = getBundleId(definitionName); return bundleId; } function getBundleId(definitionName) { return definitionName; } const res = getDisplayName('foo:bar');