Vipul Ved Prakash, long-time CPAN author and creator of Vipul’s Razor, has reported a big slowdown in Red Hat’s Perl package.

Some investigation revealed that there’s a long standing bug in Redhat Perl that causes *severe* performance degradation on code that uses the bless/overload combo. The thread on this is here: https://bugzilla.redhat.com/show_bug.cgi?id=379791.

Vipul’s analysis is a beautiful rundown of how these kinds of things should be reported, and the techie details should help you decide whether you want to rebuild Perl from source, or wait for updated packages for RHEL and Fedora.

Pete Krawczyk sent me a few comments:

RedHat acknowledges that their patching of Perl caused slowness; if you’re doing serious work with default Perl on RedHat, you might want to consider building your own until a proper patch comes along. The problem currently affects Fedora 9, RedHat 5 and spin-offs like CentOS 5. The main symptom is exponential slowdown during operations involving overloaded operators; many common modules (such as JSON and URI) are also affected.

Some other links:

And here’s my code to illustrate the slowdown, based on the original code in Vipul’s article:

#!/usr/bin/perl
use Time::HiRes;
use overload q( sub {};
my %h;
$|++;
print "Pass#tPass timetTotal timen";
my $bigstart = Time::HiRes::time();
for my $i ( 1..50 ) {
my $start = Time::HiRes::time();
for my $j ( 1..1000 ) {
$h{$i*1000 + $j} = bless [ ] => 'main';
}
my $now = Time::HiRes::time();
printf( "#%2dt%ft%fn", $i, $now-$start, $now-$bigstart );
}