View Issue Details

IDProjectCategoryView StatusLast Update
0002357CentOS-5perlpublic2009-09-29 02:35
Reporterpjsg 
PrioritynormalSeveritymajorReproducibilityalways
Status assignedResolutionopen 
Product Version5.0 - x86_64 
Target VersionFixed in Version 
Summary0002357: perl-5.8.8-10 has pathological performance problem compared with stock 5.8.8 build
DescriptionThe program below behaves very badly on perl-5.8.8-10. In fact, according to someone at redhat, the problem exists in perl-5.8.8-25 as well. The root cause appears to be the 27512 patch. In particular, all the CPU time is spent inside the function that was introduced by that patch. I have opened a bug on bugs.perl.org (http://rt.perl.org/rt3/Public/Bug/Display.html?id=45529) on this issue (I originally thought it was a 64-bit issue).

I tried to rebuild the -10 rpm without the 27512 (and the associated test case patch), but the resulting RPM did not run cleanly on my system -- even though it passed all the build tests. I suspect that some aspect of my build environment was not correct.

******** testcase
use strict;

use Time::HiRes qw(time);
use HTTP::Request;

my %l;

print "This test should print 20 lines of approximately equal elapsed times\nto perform the same series of operations repeatedly.\n";
print "The operations are create 1000 HTTP::Request objects and store them into a hash\n\n";
print "On my 32-bit linux machine running 5.8.1 it does so\n";
print "On my 64-bit linux machine running 5.8.8-10 the times increase dramatically\n";
print "starting at 0.07 seconds and ending at 1.9 seconds to perform 1000 object creations and stores\n\n";

my $now = time;
    for (my $i = 0; $i < 20000; $i++) {
    my $dt = HTTP::Request->new(GET => "http://localhost/");

        $l{$i} = $dt;
        if ($i % 1000 == 999) {
            print time - $now," seconds\n";
            $now = time;
        }
    }
********
TagsNo tags attached.

Activities

ant

ant

2007-11-20 06:57

reporter   ~0006341

Yes, I came here to report another performance issue relating to this patch and another. Its the same bug as on RH's bugzilla here:

https://bugzilla.redhat.com/show_bug.cgi?id=379791
and (in more detail):
https://bugzilla.redhat.com/show_bug.cgi?id=253728

The recommended fix is to remove patches 27509 & 27512.

I did this and created a 5.8.8-10.3 which made the following difference (on a very fast 8 core machine):

The test file is from RHs bugzilla and reproduced here:

#!/usr/bin/perl
use overload q(<) => sub {};
my %h;
for (my $i=0; $i<50000; $i++) {
    $h{$i} = bless [ ] => 'main';
    print STDERR '.' if $i % 1000 == 0;
}

[root@localhost ~]# time ./stour-test.pl
..................................................
real 0m4.802s
user 0m4.794s
sys 0m0.007s
[root@localhost ~]# rpm -Uvh /usr/src/redhat/RPMS/i386/perl-5.8.8-10.3.i386.rpm
Preparing... ########################################### [100%]
   1:perl ########################################### [100%]
[root@localhost ~]# time ./stour-test.pl
..................................................
real 0m0.107s
user 0m0.095s
sys 0m0.013s

[root@localhost SPECS]# diff -u perl.spec*
--- perl.spec 2007-10-24 01:46:56.000000000 +0930
+++ perl.spec.5.8.8-10.3 2007-11-20 17:24:40.000000000 +1030
@@ -5,7 +5,7 @@
 %define multilib_64_archs x86_64 s390x ppc64 sparc64
 
 %define perlver 5.8.8
-%define perlrel 10%{?dist}.2
+%define perlrel 10%{?dist}.3
 %define perlepoch 4
 
 %{?!perl_debugging: %define perl_debugging 0}
@@ -160,8 +160,8 @@
 Patch27116: perl-5.8.8-U27116.patch
 Patch27391: perl-5.8.8-U27391.patch
 Patch27426: perl-5.8.8-U27426.patch
-Patch27509: perl-5.8.8-U27509.patch
-Patch27512: perl-5.8.8-U27512.patch
+#Patch27509: perl-5.8.8-U27509.patch
+#Patch27512: perl-5.8.8-U27512.patch
 Patch27604: perl-5.8.8-U27604.patch
 Patch27605: perl-5.8.8-U27605.patch
 Patch27914: perl-5.8.8-U27914.patch
@@ -369,9 +369,9 @@
 
 %patch27426 -p1
 
-%patch27509 -p1
+#%patch27509 -p1
 
-%patch27512 -p1
+#%patch27512 -p1
 
 %patch27604 -p1

These two patches absolutely kill the speed of web apps based on catalyst and DBIx-Class making them a real show stopper if you use these frameworks.
pjsg

pjsg

2007-11-20 12:45

reporter   ~0006350

I got feedback from the original author of the 27512 patch, and he said:

>> They probably now need changes 31996, 32018, 32019 and 32025 which cover just
about every construction that uses bless on CPAN. The test program is now
linear, as are a lot of others.
STiAT

STiAT

2009-03-09 14:13

reporter   ~0008894

Bugfix of RedHat is available for this (perl-5.8.8-18) by 2009-01-20

http://rhn.redhat.com/errata/RHBA-2009-0117.html

The description contains
379791 - perl bless/overload performance problem

As I know, CentOS hasn't got this patchlevel of perl yet (5.8.8-15 right now?).

Would be nice if CentOS could update perl some day to the rh version which fixes this issue.
ant

ant

2009-09-29 02:35

reporter   ~0009988

CentOS current / 5.3 has the fixed perl rpm out of the box, and updating prior versions will bring them up to speed.

Issue History

Date Modified Username Field Change
2007-09-25 18:48 pjsg New Issue
2007-09-25 18:48 pjsg Status new => assigned
2007-11-20 06:57 ant Note Added: 0006341
2007-11-20 12:45 pjsg Note Added: 0006350
2009-03-09 14:13 STiAT Note Added: 0008894
2009-09-29 02:35 ant Note Added: 0009988