Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

( #40700=categorized answer: print w/ replies, xml ) Need Help??

Q&A > regular expressions > Regex anchor speed ?: Is /^.*X/ faster than /X/ ? contributed by extremely

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? =)

Comment on Answer: Regex anchor speed ?: Is /^.*X/ faster than /X/ ?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-08-30 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (346 votes), past polls