Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Regex anchor speed ?: Is /^.*X/ faster than /X/ ?

by extremely (Priest)
on Nov 09, 2000 at 16:34 UTC ( #40700=note: print w/replies, xml ) Need Help??


in reply to Regex anchor speed ?: Is /^.*X/ faster than /X/ ?

I'd think about using:  &Frobnitz($_) if index $_, '@'; instead. I got this:
        Rate regexp  index
regexp 826/s     --   -10%
index  921/s    11%     --

with Benchmark. Why throw the regex engine at a single character when there is lovely little function just for that? =)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://40700]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2016-12-03 11:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (55 votes). Check out past polls.