Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by vsespb (Chaplain)
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 (Chancellor) 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?
[choroba]: I can't connect to www.perlmonks.org, but without www, it works.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2017-07-25 20:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (379 votes). Check out past polls.