Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 (Bishop) 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?
[Corion]: Hmm - the longer I work, the more such sentences I collect:
[Corion]: "If I wanted to work with people, I would have become a coroner."
[Corion]: "If I wanted to work with hot air, I would have become a baloonist"
[Corion]: "If I wanted to work with flaps, I would have become a mailman"
[Corion]: (I'm not sure if the last one works in English too ;) )

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-09-21 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (248 votes). Check out past polls.

    Notices?