>>>>> "CO" == Chas Owens <chas.ow...@gmail.com> writes:

  CO> On Fri, May 28, 2010 at 12:44, Uri Guttman <u...@stemsystems.com> wrote:

  >> the negated char class is usually faster than most similar methods. i
  >> just like it as it says what i really want - a string without any - chars.
  >> also anchoring helps too in saying this string must be at the beginning
  >> (he wants the first field).

  CO> Really?  I have never found it so.  Could you explain what is wrong
  CO> with my benchmark (I get similar results on 5.12)?

on the surface i see nothing wrong with your benchmark. the speed
differences are relatively minor in all three cases. i distinctly recall
that negated char classes were faster but it could be for older
perls. they have continually optimized the regex engine over the years.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to