Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Efficient regex search on array table

by kcott (Archbishop)
on Dec 16, 2022 at 04:16 UTC ( [id://11148911] : note . print w/replies, xml ) Need Help??


in reply to Re^2: Efficient regex search on array table
in thread Efficient regex search on array table

G'day Polyglot,

Take a look at the benchmark section (at end, in spoiler) of my "Regex /o modifier: what bugs?" post from earlier today. It may give you some insight into why qr// is not providing any efficiency improvement.

I suggest writing your own benchmark with $str and $re more closely reflecting your real code and data. use_m() & as_qr() would likely be useful for you; use_o() may be helpful but that depends on parts of your code that you haven't shown; I don't think raw_m() or raw_o() are relevant for you.

By the way, I had mentioned that I was using Perl v5.36 which could be providing optimisations; what version of Perl are you using?

— Ken