Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Spl vs Regx
(version: 0)
Comparing performance of:
Split vs Regex
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
const pathstr = "/abc/def/ghi/jkl const regex = /[^\/]+/g; function regspl { if (pathstr == "/") { return [] } else { return pathstr.match(regex); } }
Tests:
Split
pathstr.split('/').filter(s=>s)
Regex
regspl()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Split
Regex
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?