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

Re^4: Style question: regex versus string builtin function

by ikegami (Patriarch)
on Oct 02, 2007 at 14:15 UTC ( [id://642113]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Style question: regex versus string builtin function
in thread Style question: regex versus string builtin function

You seem to have missed the point. The problem with $`, $&, $' is not that it slows down a regex, it's that it slows down *all* regexs that have no captures, say like the one in matchcontext. Your Benchmark is useless.

Replies are listed 'Best First'.
Re^5: Style question: regex versus string builtin function
by lima1 (Curate) on Oct 03, 2007 at 09:17 UTC
    No, it is not useless. Comment out the match variables in matchvars. It is not really "considerable slower" with that small strings. I just wanted to say that match variables are not as evil as everybody says and that they CAN speed things significantly up (like 500% in the benchmark). But you must be careful.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-29 00:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found