I though regex here will be the fastest.
I have no idea why you thought that. Perhaps you could explain your reasoning?
An exact string match and an index match should beat 2 dynamic regexen into a cocked hat for speed.
if ($subpath eq $target || 0 == index $subpath, "$target/") {
Try profiling that and see if it improves matters for you.
🦛
In reply to Re: experiencing slowness due to matching algorithm
by hippo
in thread experiencing slowness due to matching algorithm
by ovedpo15
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |