Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: SUBSTR OR REGEX: WHICH WILL YOU FAVOUR?

by vsespb (Hermit)
on Oct 26, 2013 at 22:11 UTC ( #1059851=note: print w/ replies, xml ) Need Help??


in reply to Re: SUBSTR OR REGEX: WHICH WILL YOU FAVOUR?
in thread SUBSTR OR REGEX: WHICH WILL YOU FAVOUR?

Recently I found simple regexp $x =~ /Something/ is just 5%-10% slower than index (on small inputs)

I actually can't see reason why perl won't recognize /Something/ as something that can be replaced by index() at compile time

And 10% is just implementation overhead.


Comment on Re^2: SUBSTR OR REGEX: WHICH WILL YOU FAVOUR?
Re^3: substr or regex: which will you favour?
by LanX (Canon) on Oct 26, 2013 at 23:13 UTC
        > something that proofs my words.

        Really? ;)

        -> Re^5: How Index function works??

        Corion: So, I don't understand what happens, ...

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-07-14 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (254 votes), past polls