Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

severe regexp performance problem compared to 5.6 #7042

Closed
p5pRT opened this issue Jan 18, 2004 · 14 comments
Closed

severe regexp performance problem compared to 5.6 #7042

p5pRT opened this issue Jan 18, 2004 · 14 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 18, 2004

Migrated from rt.perl.org#24936 (status was 'resolved')

Searchable as RT24936$

@p5pRT
Copy link
Author

p5pRT commented Jan 18, 2004

From kai+perl@conti.nu

Created by kai+perl@conti.nu

A severe regexp performance problem seems to exist in perl 5.8.*
Platforms this was reproduced on​:
- FBSD-i386 4.8R , perl 5.8.0 on Pentium-M/1.4Ghz under VMware Workstation 4.0.5
  stock install of Perl under this distribution of FBSD.
- BSD/OS 4.1 (BSDI), perl 5.8.2 and 5.8.3 on Celereon/533Mhz and PIII/550Mhz
  default install of perl 5.8.2 and 5.8.3 per INSTALL file.

While upgrading from perl 5.005p3 to 5.8.2, some existing applications
seemed to take a severe performance hit in their central loops
containing a number of regexps.

Upon closer examination, it was determined that certain regexp's using
".*" constructs seem to execute more than 100 times slower than in
perl 5.005p3, resulting in multiple cascading failures in these applications.

Example​:

$line = 'Jan 16 15​:56​:37 sonet sendmail[9368]​: i0CGl7a1015852​: to=<abuse@​tiscali.be>,<abuse@​tiscalinet.be>, ctladdr=<spamshield@​conti.nu> (100/101), delay=4+04​:09​:29, xdelay=00​:00​:00, mailer=esmtp, pri=17436067, relay=mailer.tiscali.be., dsn=4.0.0,stat=Deferred​: mailer.tiscali.be.​: Network is unreachable';

regexps executed performing at a ridiculously slow pace​:
A) $line =~ /(?i).*(dable|z).*$/ ; # needs 33 ms to execute! 29 loop runs/s
  (note how the alternate strings 'dable' and 'z' do not occur in $line)
B) $line =~ /(?i).*?(dable|z).*?$/ ; # needs 33 ms to execute! 29 loop runs/s
C) $line =~ /(?i).*?(?​:dable|z).*?$/ ; # needs 33 ms to execute! 29 loop runs/s

compare to​:
D) $line =~ /(?i).*(able|z).*$/ ; # needs 0.07 ms to execute, 2700 loop runs/sec.
E) $line =~ /(?i).*(dable|z)$/ ; # needs 0.2 ms to execute, 1500 loop runs/sec.
F) $line =~ /(?i)(dable|z).*$/ ; # needs 0.2 ms to execute, 1500 loop runs/sec.

While leading .* is redundant at most, the bahaviour gets outright bizarre
given the performance of A) through C) being strongly dependent on the length
of $line and whether the ()-enclosed alternate strings exist or not.

Also noteworthy​: Why is D) performing so much better than E) and F) ?

We can safely assume that LOTS of less than perfectly designed regexps
exist in the field, matching the above.

Thanks for your consideration,

Kai Schlichting
kai+perl@​conti.nu

Perl Info

Flags:
    category=core
    severity=critical

Site configuration information for perl v5.8.3:

Configured by kai at Thu Jan 15 23:51:39 EST 2004.

Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
  Platform:
    osname=bsdos, osvers=4.1, archname=i386-bsdos
    uname='bsdos sonet.conti.nu 4.1 bsdi bsdos 4.1 kernel #8: fri sep 5 11:44:24 edt 2003 root@sonet.conti.nu:usrsrcsyscompilesonet i386 '
    config_args='-de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='egcs-2.91.66 19990314 (egcs-1.1.2 release)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/X11/lib -L/usr/local/lib'
    libpth=/usr/local/lib /usr/shlib /shlib /lib /usr/lib /usr/X11/lib
    libs=-lutil -lbind -ldl -lm -lc
    perllibs=-lutil -lbind -ldl -lm -lc
    libc=/shlib/libc.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -Wl,-rpath,/usr/local/lib/perl5/5.8.3/i386-bsdos/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -x  -L/usr/X11/lib -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.8.3:
    /usr/local/lib/perl5/5.8.3/i386-bsdos
    /usr/local/lib/perl5/5.8.3
    /usr/local/lib/perl5/site_perl/5.8.3/i386-bsdos
    /usr/local/lib/perl5/site_perl/5.8.3
    /usr/local/lib/perl5/site_perl/5.8.2/i386-bsdos
    /usr/local/lib/perl5/site_perl/5.8.2
    /usr/local/lib/perl5/site_perl
    .


Environment for perl v5.8.3:
    HOME=/usr/home/kai
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/bin:/usr/bin:/usr/contrib/bin:/usr/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/X11/bin:/usr/local/bin:/usr/TeX/bin:/bin:/usr/games:/usr/contrib/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/X11/bin:/usr/local/bin:/usr/TeX/bin:/bin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2004

From @Abigail

On Sun, Jan 18, 2004 at 01​:11​:12AM -0000, kai+perl@​conti.nu (via RT) wrote​:

# New Ticket Created by kai+perl@​conti.nu
# Please include the string​: [perl #24936]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=24936 >

This is a bug report for perl from kai+perl@​conti.nu,
generated with the help of perlbug 1.34 running under perl v5.8.3.

-----------------------------------------------------------------
[Please enter your report here]

A severe regexp performance problem seems to exist in perl 5.8.*
Platforms this was reproduced on​:
- FBSD-i386 4.8R , perl 5.8.0 on Pentium-M/1.4Ghz under VMware Workstation 4.0.5
stock install of Perl under this distribution of FBSD.
- BSD/OS 4.1 (BSDI), perl 5.8.2 and 5.8.3 on Celereon/533Mhz and PIII/550Mhz
default install of perl 5.8.2 and 5.8.3 per INSTALL file.

While upgrading from perl 5.005p3 to 5.8.2, some existing applications
seemed to take a severe performance hit in their central loops
containing a number of regexps.

Upon closer examination, it was determined that certain regexp's using
".*" constructs seem to execute more than 100 times slower than in
perl 5.005p3, resulting in multiple cascading failures in these applications.

Example​:

$line = 'Jan 16 15​:56​:37 sonet sendmail[9368]​: i0CGl7a1015852​: to=<abuse@​tiscali.be>,<abuse@​tiscalinet.be>, ctladdr=<spamshield@​conti.nu> (100/101), delay=4+04​:09​:29, xdelay=00​:00​:00, mailer=esmtp, pri=17436067, relay=mailer.tiscali.be., dsn=4.0.0,stat=Deferred​: mailer.tiscali.be.​: Network is unreachable';

regexps executed performing at a ridiculously slow pace​:
A) $line =~ /(?i).*(dable|z).*$/ ; # needs 33 ms to execute! 29 loop runs/s
(note how the alternate strings 'dable' and 'z' do not occur in $line)
B) $line =~ /(?i).*?(dable|z).*?$/ ; # needs 33 ms to execute! 29 loop runs/s
C) $line =~ /(?i).*?(?​:dable|z).*?$/ ; # needs 33 ms to execute! 29 loop runs/s

compare to​:
D) $line =~ /(?i).*(able|z).*$/ ; # needs 0.07 ms to execute, 2700 loop runs/sec.
E) $line =~ /(?i).*(dable|z)$/ ; # needs 0.2 ms to execute, 1500 loop runs/sec.
F) $line =~ /(?i)(dable|z).*$/ ; # needs 0.2 ms to execute, 1500 loop runs/sec.

While leading .* is redundant at most, the bahaviour gets outright bizarre
given the performance of A) through C) being strongly dependent on the length
of $line and whether the ()-enclosed alternate strings exist or not.

Also noteworthy​: Why is D) performing so much better than E) and F) ?

Because D is a match. For D, the regex engine will try to match 'able|e'
starting from the end. Since the string ends at 'able', the fact the
string matches is determined quickly.

Here's a program that shows there's a huge slowdown between 5.005_03
and 5.6.0 and it even gets slower after 5.6.0.

#!/usr/bin/perl -w

use strict;

my @​versions = qw /5.005 5.005_01 5.005_02 5.005_03
  5.6.0 5.6.1 5.6.2
  5.8.0 5.8.1 5.8.2 5.8.3
  5.9.0/;

my $prog = <<'--';

use Benchmark qw /timeit timestr/;
use vars qw /$line/;

my $count = shift || 100;

$line = 'Jan 16 15​:56​:37 sonet sendmail[9368]​: i0CGl7a1015852​: ' .
  'to=<abuse@​tiscali.be>,<abuse@​tiscalinet.be>, ' .
  'ctladdr=<spamshield@​conti.nu> (100/101), delay=4+04​:09​:29, ' .
  'xdelay=00​:00​:00, mailer=esmtp, pri=17436067, ' .
  'relay=mailer.tiscali.be., dsn=4.0.0,stat=Deferred​: ' .
  'mailer.tiscali.be.​: Network is unreachable';

my @​regexes = (
  [A => '(?i).*(dable|z).*$'],
  [B => '(?i).*?(dable|z).*?$'],
  [C => '(?i).*?(?​:dable|z).*?$'],
  [D => '(?i).*(able|z).*$'],
  [E => '(?i).*(dable|z)$'],
  [F => '(?i)(dable|z).*$'],
);

foreach my $entry (@​regexes) {
  my ($name, $re) = @​$entry;
  my $t = timeit $count => "\$​::line =~ /$re/";
  my $run = $$t [1] + $$t [2];
  my $avg = sprintf "%.2f" => 1_000 * $run / $count;
  print "\t$name takes $avg msecs. The match was ";
  print $line =~ /$re/ ? "succesful.\n" : "not succesful.\n";
}

--

foreach my $version (@​versions) {
  print "$version​:\n";
  system "/opt/perl/$version/bin/perl" => '-e', $prog;
}

__END__
5.005​:
  A takes 0.10 msecs. The match was not succesful.
  B takes 0.10 msecs. The match was not succesful.
  C takes 0.10 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.10 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.005_01​:
  A takes 0.10 msecs. The match was not succesful.
  B takes 0.10 msecs. The match was not succesful.
  C takes 0.10 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.10 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.005_02​:
  A takes 0.10 msecs. The match was not succesful.
  B takes 0.10 msecs. The match was not succesful.
  C takes 0.10 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.10 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.005_03​:
  A takes 0.10 msecs. The match was not succesful.
  B takes 0.10 msecs. The match was not succesful.
  C takes 0.10 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.10 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.6.0​:
  A takes 12.50 msecs. The match was not succesful.
  B takes 12.90 msecs. The match was not succesful.
  C takes 12.20 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.20 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.6.1​:
  A takes 16.90 msecs. The match was not succesful.
  B takes 17.70 msecs. The match was not succesful.
  C takes 15.40 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.20 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.6.2​:
  A takes 16.50 msecs. The match was not succesful.
  B takes 17.00 msecs. The match was not succesful.
  C takes 14.60 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.20 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.8.0​:
  A takes 21.10 msecs. The match was not succesful.
  B takes 20.10 msecs. The match was not succesful.
  C takes 19.90 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.30 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.8.1​:
  A takes 19.50 msecs. The match was not succesful.
  B takes 20.20 msecs. The match was not succesful.
  C takes 18.70 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.30 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.8.2​:
  A takes 19.90 msecs. The match was not succesful.
  B takes 19.70 msecs. The match was not succesful.
  C takes 18.20 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.30 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.8.3​:
  A takes 19.70 msecs. The match was not succesful.
  B takes 19.40 msecs. The match was not succesful.
  C takes 18.40 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.30 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.
5.9.0​:
  A takes 19.10 msecs. The match was not succesful.
  B takes 19.80 msecs. The match was not succesful.
  C takes 17.80 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.30 msecs. The match was not succesful.
  F takes 0.10 msecs. The match was not succesful.

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2004

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Feb 15, 2004

From @andk

On Wed, 21 Jan 2004 23​:44​:20 +0100, Abigail <abigail@​abigail.nl> said​:

  > Here's a program that shows there's a huge slowdown between 5.005_03
  > and 5.6.0 and it even gets slower after 5.6.0.

The tiny patch with the huge impact was 4759. On my system your
benchmark takes these times​:

installed-perls/perl/pu96yqS/perl-5.005_63@​4759/bin/perl
  A takes 7.60 msecs. The match was not succesful.
  B takes 8.10 msecs. The match was not succesful.
  C takes 6.90 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.10 msecs. The match was not succesful.
  F takes 0.00 msecs. The match was not succesful.

For a reference, bleadperl takes

installed-perls/perl/p7Z5q87/perl-5.8.0@​22306/bin/perl
  A takes 12.80 msecs. The match was not succesful.
  B takes 12.80 msecs. The match was not succesful.
  C takes 11.60 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.20 msecs. The match was not succesful.
  F takes 0.00 msecs. The match was not succesful.

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Nov 11, 2009

From sgc294@internode.on.net

This needs to be tested to see if it still exists under 5.10

Cheers

Paul Fenwick via Andrew Dent

@p5pRT
Copy link
Author

p5pRT commented Nov 11, 2009

From [Unknown Contact. See original ticket]

This needs to be tested to see if it still exists under 5.10

Cheers

Paul Fenwick via Andrew Dent

@p5pRT
Copy link
Author

p5pRT commented Nov 11, 2009

From sgc294@internode.on.net

Testing under modern versions of Perl (Strawberry Perl)

C​:\test>perl regextest.pl
5.010000
  A takes 2.18 msecs. The match was not succesful.
  B takes 2.34 msecs. The match was not succesful.
  C takes 2.03 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.00 msecs. The match was not succesful.
  F takes 0.00 msecs. The match was not succesful.

C​:\test>perl regextest.pl
5.008008
  A takes 5.00 msecs. The match was not succesful.
  B takes 5.47 msecs. The match was not succesful.
  C takes 4.53 msecs. The match was not succesful.
  D takes 0.00 msecs. The match was succesful.
  E takes 0.00 msecs. The match was not succesful.
  F takes 0.00 msecs. The match was not succesful.

Cheers

Andrew Dent

@p5pRT
Copy link
Author

p5pRT commented Nov 11, 2009

From @JohnPeacock

Andrew Dent via RT wrote​:

5.010000
A takes 2.18 msecs. The match was not succesful.

5.008008
A takes 5.00 msecs. The match was not succesful.

You're looking at this backwards. Perl 5.10.x included lots of
improvements to the regexp internals that has improved things over
5.8.x. If you want those improvements, use Perl 5.10.x...

John

@p5pRT
Copy link
Author

p5pRT commented Nov 11, 2009

From @craigberry

On Wed, Nov 11, 2009 at 12​:00 PM, John Peacock
<john.peacock@​havurah-software.org> wrote​:

Andrew Dent via RT wrote​:

5.010000
       A takes 2.18 msecs. The match was not succesful.

5.008008
       A takes 5.00 msecs. The match was not succesful.

You're looking at this backwards.  Perl 5.10.x included lots of improvements
to the regexp internals that has improved things over 5.8.x.  If you want
those improvements, use Perl 5.10.x...

It makes a lot more sense in the context of the RT ticket​:

http​://rt.perl.org/rt3/Public/Bug/Display.html?id=24936

where Paul's question came through before Andrew's answer, and it is
evident that the original bug report was about certain regex matches
involving .* taking about twice as long under 5.8.0 as under 5.005.

@p5pRT
Copy link
Author

p5pRT commented Jan 2, 2010

From @iabyn

On Wed, Nov 11, 2009 at 01​:56​:22PM -0600, Craig A. Berry wrote​:

On Wed, Nov 11, 2009 at 12​:00 PM, John Peacock
<john.peacock@​havurah-software.org> wrote​:

Andrew Dent via RT wrote​:

5.010000
       A takes 2.18 msecs. The match was not succesful.

5.008008
       A takes 5.00 msecs. The match was not succesful.

You're looking at this backwards.  Perl 5.10.x included lots of improvements
to the regexp internals that has improved things over 5.8.x.  If you want
those improvements, use Perl 5.10.x...

It makes a lot more sense in the context of the RT ticket​:

http​://rt.perl.org/rt3/Public/Bug/Display.html?id=24936

where Paul's question came through before Andrew's answer, and it is
evident that the original bug report was about certain regex matches
involving .* taking about twice as long under 5.8.0 as under 5.005.

I quick check running the test script against various old and new perls
shows the slowdown is still present, with bleed worse than 5.10.x​:

(These are all debugging perls)

perl5322​:
  A takes 0.00 msecs. The match was not succesful.
  B takes 0.10 msecs. The match was not succesful.
  C takes 0.10 msecs. The match was not succesful.

perl553​:
  A takes 0.10 msecs. The match was not succesful.
  B takes 0.00 msecs. The match was not succesful.
  C takes 0.10 msecs. The match was not succesful.

perl560​:
  A takes 5.80 msecs. The match was not succesful.
  B takes 7.90 msecs. The match was not succesful.
  C takes 7.20 msecs. The match was not succesful.

perl580​:
  A takes 9.90 msecs. The match was not succesful.
  B takes 11.50 msecs. The match was not succesful.
  C takes 10.50 msecs. The match was not succesful.

perl589​:
  A takes 10.10 msecs. The match was not succesful.
  B takes 10.90 msecs. The match was not succesful.
  C takes 9.90 msecs. The match was not succesful.

perl5101​:
  A takes 5.50 msecs. The match was not succesful.
  B takes 6.10 msecs. The match was not succesful.
  C takes 4.50 msecs. The match was not succesful.

bleadperl​:
  A takes 12.50 msecs. The match was not succesful.
  B takes 13.40 msecs. The match was not succesful.
  C takes 12.60 msecs. The match was not succesful.

--
Never do today what you can put off till tomorrow.

@p5pRT
Copy link
Author

p5pRT commented May 2, 2012

From @jkeenan

On Sat Jan 02 07​:12​:30 2010, davem wrote​:

On Wed, Nov 11, 2009 at 01​:56​:22PM -0600, Craig A. Berry wrote​:

On Wed, Nov 11, 2009 at 12​:00 PM, John Peacock
<john.peacock@​havurah-software.org> wrote​:

Andrew Dent via RT wrote​:

5.010000
� � � �A takes 2.18 msecs. The match was not succesful.

5.008008
� � � �A takes 5.00 msecs. The match was not succesful.

You're looking at this backwards. �Perl 5.10.x included lots of
improvements
to the regexp internals that has improved things over 5.8.x. �If
you want
those improvements, use Perl 5.10.x...

It makes a lot more sense in the context of the RT ticket​:

http​://rt.perl.org/rt3/Public/Bug/Display.html?id=24936

where Paul's question came through before Andrew's answer, and it is
evident that the original bug report was about certain regex matches
involving .* taking about twice as long under 5.8.0 as under 5.005.

I quick check running the test script against various old and new
perls
shows the slowdown is still present, with bleed worse than 5.10.x​:

(These are all debugging perls)

perl5322​:
A takes 0.00 msecs. The match was not succesful.
B takes 0.10 msecs. The match was not succesful.
C takes 0.10 msecs. The match was not succesful.

perl553​:
A takes 0.10 msecs. The match was not succesful.
B takes 0.00 msecs. The match was not succesful.
C takes 0.10 msecs. The match was not succesful.

perl560​:
A takes 5.80 msecs. The match was not succesful.
B takes 7.90 msecs. The match was not succesful.
C takes 7.20 msecs. The match was not succesful.

perl580​:
A takes 9.90 msecs. The match was not succesful.
B takes 11.50 msecs. The match was not succesful.
C takes 10.50 msecs. The match was not succesful.

perl589​:
A takes 10.10 msecs. The match was not succesful.
B takes 10.90 msecs. The match was not succesful.
C takes 9.90 msecs. The match was not succesful.

perl5101​:
A takes 5.50 msecs. The match was not succesful.
B takes 6.10 msecs. The match was not succesful.
C takes 4.50 msecs. The match was not succesful.

bleadperl​:
A takes 12.50 msecs. The match was not succesful.
B takes 13.40 msecs. The match was not succesful.
C takes 12.60 msecs. The match was not succesful.

This doesn't get better​:

$ /usr/bin/perl 24936.pl 1000
Perl version​: 5.010000
  A takes 2.45 msecs. The match was not successful.
  B takes 2.81 msecs. The match was not successful.
  C takes 2.47 msecs. The match was not successful.
  D takes 0.00 msecs. The match was successful.
  E takes 0.01 msecs. The match was not successful.
  F takes 0.00 msecs. The match was not successful.

$ /usr/local/bin/perl5.12.0 24936.pl 1000
Perl version​: 5.012000
  A takes 5.01 msecs. The match was not successful.
  B takes 5.16 msecs. The match was not successful.
  C takes 5.06 msecs. The match was not successful.
  D takes 0.00 msecs. The match was successful.
  E takes 0.03 msecs. The match was not successful.
  F takes 0.04 msecs. The match was not successful.

$ perl 24936.pl 1000
Perl version​: 5.014000
  A takes 5.14 msecs. The match was not successful.
  B takes 5.48 msecs. The match was not successful.
  C takes 5.03 msecs. The match was not successful.
  D takes 0.00 msecs. The match was successful.
  E takes 4.92 msecs. The match was not successful.
  F takes 0.06 msecs. The match was not successful.

Run on Linux/i386.

@p5pRT
Copy link
Author

p5pRT commented May 2, 2012

From @jkeenan

24936.pl

@p5pRT p5pRT closed this as completed Mar 27, 2017
@p5pRT
Copy link
Author

p5pRT commented Mar 27, 2017

@iabyn - Status changed from 'open' to 'resolved'

@p5pRT
Copy link
Author

p5pRT commented Mar 27, 2017

From @iabyn

On Sun, Feb 15, 2004 at 05​:00​:32AM +0100, Andreas J Koenig wrote​:

On Wed, 21 Jan 2004 23​:44​:20 +0100, Abigail <abigail@​abigail.nl> said​:

Here's a program that shows there's a huge slowdown between 5.005_03
and 5.6.0 and it even gets slower after 5.6.0.

The tiny patch with the huge impact was 4759. On my system your
benchmark takes these times​:

installed-perls/perl/pu96yqS/perl-5.005_63@​4759/bin/perl
A takes 7.60 msecs. The match was not succesful.
B takes 8.10 msecs. The match was not succesful.
C takes 6.90 msecs. The match was not succesful.
D takes 0.00 msecs. The match was succesful.
E takes 0.10 msecs. The match was not succesful.
F takes 0.00 msecs. The match was not succesful.

For a reference, bleadperl takes

installed-perls/perl/p7Z5q87/perl-5.8.0@​22306/bin/perl
A takes 12.80 msecs. The match was not succesful.
B takes 12.80 msecs. The match was not succesful.
C takes 11.60 msecs. The match was not succesful.
D takes 0.00 msecs. The match was succesful.
E takes 0.20 msecs. The match was not succesful.
F takes 0.00 msecs. The match was not succesful.

This performance issue appears to have been fixed in 5.22.0;
closing.

perl561o​:
  A takes 1.53000 msecs. The match was not succesful.
  B takes 1.75000 msecs. The match was not succesful.
  C takes 1.64000 msecs. The match was not succesful.
  D takes 0.00000 msecs. The match was succesful.
  E takes 0.01000 msecs. The match was not succesful.
  F takes 0.01000 msecs. The match was not succesful.
perl5200o​:
  A takes 1.50000 msecs. The match was not succesful.
  B takes 1.82000 msecs. The match was not succesful.
  C takes 1.66000 msecs. The match was not succesful.
  D takes 0.00000 msecs. The match was succesful.
  E takes 0.01000 msecs. The match was not succesful.
  F takes 0.00000 msecs. The match was not succesful.
perl5200o​:
  A takes 1.47000 msecs. The match was not succesful.
  B takes 1.82000 msecs. The match was not succesful.
  C takes 1.67000 msecs. The match was not succesful.
  D takes 0.00000 msecs. The match was succesful.
  E takes 0.01000 msecs. The match was not succesful.
  F takes 0.00000 msecs. The match was not succesful.
perl5220o​:
  A takes 0.01000 msecs. The match was not succesful.
  B takes 0.01000 msecs. The match was not succesful.
  C takes 0.01000 msecs. The match was not succesful.
  D takes 0.00000 msecs. The match was succesful.
  E takes 0.01000 msecs. The match was not succesful.
  F takes 0.00000 msecs. The match was not succesful.
perl5240o​:
  A takes 0.01000 msecs. The match was not succesful.
  B takes 0.01000 msecs. The match was not succesful.
  C takes 0.01000 msecs. The match was not succesful.
  D takes 0.00000 msecs. The match was succesful.
  E takes 0.01000 msecs. The match was not succesful.
  F takes 0.00000 msecs. The match was not succesful.
perl52510o​:
  A takes 0.01000 msecs. The match was not succesful.
  B takes 0.01000 msecs. The match was not succesful.
  C takes 0.01000 msecs. The match was not succesful.
  D takes 0.00000 msecs. The match was succesful.
  E takes 0.01000 msecs. The match was not succesful.
  F takes 0.00000 msecs. The match was not succesful.

--
This email is confidential, and now that you have read it you are legally
obliged to shoot yourself. Or shoot a lawyer, if you prefer. If you have
received this email in error, place it in its original wrapping and return
for a full refund. By opening this email, you accept that Elvis lives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant