Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
FINAL test with regex/with split/without both
(version: 0)
Comparing performance of:
with regex vs with split vs without both
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
with regex
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');
with split
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');
without both
function getDisplayName(definitionName) { return definitionName.substring(definitionName.lastIndexOf(':') + 1); } const res = getDisplayName('foo:bar');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
with regex
with split
without both
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
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/OS:
Chrome 127 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
with regex
2105991.8 Ops/sec
with split
2450035.2 Ops/sec
without both
32517570.0 Ops/sec
Related benchmarks:
precompiled regexp vs inline (string split)
str.match vs str.Split(regex)
str.match / str.split
str.match vs str.Split in regex
split vs match with regex
Comments
Confirm delete:
Do you really want to delete benchmark?