Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Performance penalty of using qr//by LanX (Saint) |
on Dec 21, 2017 at 04:11 UTC ( [id://1205957]=note: print w/replies, xml ) | Need Help?? |
Sorry, your benchmark is too complicated, I can't easily tell how often the inner loop is executed. If it's just several times then your results may be explained by the overhead to initialize qr. Another guess is to try $s =~ /$re/; instead of $s =~ $re; (which is admittedly counterintuitive) Can't test, sorry.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|