Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Performance penalty of using qr//

by Jenda (Abbot)
on Dec 22, 2017 at 00:08 UTC ( [id://1206009]=note: print w/replies, xml ) Need Help??


in reply to Performance penalty of using qr//

IMNSHO, there's no point in using qr// for regexps that are not built out of string in variables. If the whole regex is static, Perl is clever enough to optimize it. It's only if the code contains things like $foo =~ /bar$baz\wbat/ that Perl needs some help in deciding whether it needs to compile the regex again or whether it can reuse the one from the previous iteration.

Jenda
Enoch was right!
Enjoy the last years of Rome.

Replies are listed 'Best First'.
Re^2: Performance penalty of using qr//
by Anonymous Monk on Dec 22, 2017 at 00:41 UTC

      And? It's irrelevant whether you interpolate a string or a qr// compiled regexp into a regexp. How's that in disagreement with what I wrote?

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1206009]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-25 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found