Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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: (12)
As of 2017-01-19 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (170 votes). Check out past polls.