On Mon, Aug 12, 2002 at 01:56:49PM +0000, jryan wrote: > # New Ticket Created by jryan > # Please include the string: [perl #16144] > # in the subject line of all future correspondence about this issue. > # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16144 > > > > Small speed patch for assemble.pl here... > Benchmarks that I've done show that the new expression will > match about 40% faster for strings that should match and fail > about 400% faster for strings that should fail. > > Not really a big deal, but speed is good right? :)
Well, I find assemble.pl too slow, so I like speed. > --- assemble_old.pl 2002-08-04 21:00:02.000000000 -0400 > +++ assemble.pl 2002-08-12 00:03:56.000000000 -0400 > @@ -263,8 +263,8 @@ sub preprocess { > } > elsif(/^\.constant \s+ > ($label_re) \s+ > - (\"(?:[^\\\"]*(?:\\.[^\\\"]*)*)\" | > - \'(?:[^\\\']*(?:\\.[^\\\']*)*)\' > + ( " (?: \\. | [^\\"]* ) " | > + ' (?: \\. | [^\\"]* ) ' > )/x) { # .constant {name} {string} > $self->{constants}{$1} = $2; > } The regexp you've changed is identical to the $str_re regexp, isn't it? In which case, does changing that section to $str_re and then changing the (global) definition for $str_re to your better version give an even bigger speedup? Nicholas Clark