Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Performance penalty of using qr// (the stupid way)

by Anonymous Monk
on Dec 21, 2017 at 07:24 UTC ( [id://1205959]=note: print w/replies, xml ) Need Help??


in reply to Performance penalty of using qr//

But the result was more than disappointing:

Same here, the benchmark doesn't run for me it simply dies

Also you're using qr (compile regex) the stupid way sub blah { my $re = qr...;

But you're not alone, see qr//i versus m//i

Replies are listed 'Best First'.
Re^2: Performance penalty of using qr// (the stupid way)
by Athanasius (Archbishop) on Dec 21, 2017 at 07:36 UTC

    the benchmark doesn't run for me it simply dies

    You’re probably running a 32-bit version of Perl. I did mention that my testing was confined to 64-bit versions, but I should have emphasised this as a requirement. Sorry.

    Also you're using qr (compile regex) the stupid way

    Thanks for the link, but I don’t understand what you’re getting at. What would the clever way be?

    Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

      compile once and cache as intended? That is  our $re; $re ||= qr...;

      im afk atm ; you might gain some insight about when regex are compiled using

      re  use re 'debug';

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-24 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found