Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Regex combining /(foo|bar)/ slower than using foreach (/foo/,/bar/) ???

by hardburn (Abbot)
on Feb 21, 2005 at 14:21 UTC ( [id://433053]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Regex combining /(foo|bar)/ slower than using foreach (/foo/,/bar/) ???
in thread Regex combining /(foo|bar)/ slower than using foreach (/foo/,/bar/) ???  

If Perl gives me the possiblity of using a 'nice' small solution (/foo|bar/) I always thought I should be able to program a faster solution with a perl PROGRAM ( the for loop ).

I wouldn't think that. At least, not if you're smart about language design. With good semantics, you provide the optimizer more information about what you're trying to do, thus allowing it to make better optimization. Unfortuately, Perl5 has hopelessly bad semantics, so this principle is mostly lost for us.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

  • Comment on Re^3: Regex combining /(foo|bar)/ slower than using foreach (/foo/,/bar/) ???

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://433053]
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-23 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found