develooper Front page | perl.perl5.porters | Postings from January 2008

Re: Slowdown in 5.10.0 regexes with atomic patterns

Thread Previous | Thread Next
From:
andreas.koenig.7os6VVqR
Date:
January 28, 2008 14:50
Subject:
Re: Slowdown in 5.10.0 regexes with atomic patterns
Message ID:
87lk697efk.fsf@k75.linux.bogus
>>>>> On Mon, 28 Jan 2008 15:35:49 +0100, Moritz Lenz <moritz@casella.verplant.org> said:

  > Andreas, could you please use your magic binary search to find out which
  > patch introduced the slowdown?

----Program----
use strict;
use warnings;
my $str = "bea" x 100;
my $re = qr/(?:be|ea|a)/;
use Benchmark qw(timeit);
use Time::HiRes qw(time);
my $start = time;
timeit(500, sub { die if $str =~ m/(?>$re+)\d/ });
my $x = time - $start;
print $x, "\n";

----Output of .../p3BBpDI/perl-5.9.3@27902/bin/perl----
0.653790950775146

----EOF ($?='0')----
----Output of .../pcL5RMw/perl-5.9.3@27903/bin/perl----
23.4941339492798

----EOF ($?='0')----

Change 27903 by davem@davem-cyril on 2006/04/19 13:56:07

        regmatch(): make IFMATCH use PUSH_STACK rather than fake recursion



-- 
andreas

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About