Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 imbibing at the Monastery: (10)
As of 2014-12-19 07:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (73 votes), past polls