in reply to Re^2: The Deceiver
in thread Why does a Perl 5.6 regex run a lot slower on Perl 5.8?
#reg.pl $s = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyyyRRRRyyyy\n" x 500; $n = 0; $n++ while ($s =~ /(.*?)RRRR\1/sg); print "$n matches\n";
time ~/bin/perl5.8.0 reg.pl 500 matches real 0m4.836s user 0m4.800s sys 0m0.010s time ~/bin/perl5.6.1 reg.pl 0 matches real 0m0.020s user 0m0.020s sys 0m0.000sSo, in fact, you are complaining that a bug got fixed. The problem is that these are extremely inefficient regular expressions because they involve a lot of backtracking. I recommend reading Mastering Regular Expressions for a detailed explanation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: The Deceiver
by perldeveloper (Scribe) on Aug 13, 2004 at 14:55 UTC | |
by tilly (Archbishop) on Aug 14, 2004 at 01:15 UTC | |
by itub (Priest) on Aug 13, 2004 at 15:12 UTC | |
by itub (Priest) on Aug 13, 2004 at 15:27 UTC |