Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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?
Replies are listed 'Best First'.
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 chilling in the Monastery: (12)
As of 2015-07-08 04:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls