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

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

by Anonymous Monk
on Dec 21, 2017 at 07:24 UTC ( #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
Node Status?
node history
Node Type: note [id://1205959]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2021-04-22 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?