Fastest versions of perl?

P

Pablo S

Hi,

Check this paradox -

Run from bash on 2 redhat systems with the same hardware:

#!/usr/bin/perl
$start=time;
my $i=20000000;

while ($i) {
$i--;
}
print "Finished!". (time - $start);


Stock redhat 7.3: 3 seconds (5.6.1)
Stock FC2: 37 seconds (5.8.3)

I first noticed this when I brought over a fast mod_perl database to
FC2 and was like, wth is this. Tests of cats and other basic
functions/loops are basically similar, or even more disparate. I did
a simple string cat loop version of the above that ran 14 times slower
on FC2. These systems are 2.4G P4's and I have 500MHz K6's running
older versions of perl and linux that smoke them.

I am wondering what platform and interpreter would be the fastest to
run a DBI intensive perl application with lots of cat's, loops, etc.
If it's an advanced feature (threading etc), chances are I don't need
it. It seems, from the data, that there is a huge difference from one
setup to the next.

Thank you all!
 
A

AlV

Pablo said:
Hi,

Check this paradox -

Run from bash on 2 redhat systems with the same hardware:

#!/usr/bin/perl
$start=time;
my $i=20000000;

while ($i) {
$i--;
}
print "Finished!". (time - $start);


Stock redhat 7.3: 3 seconds (5.6.1)
Stock FC2: 37 seconds (5.8.3)

Well, I tested your program with my different perl installations
(compiled by myself for different purposes):
Perl 5.6.1 : 4 seconds
Perl 5.8.0 : 4 seconds
Perl 5.8.4 : 4 seconds

My guess is either 5.8.3 was severely broken in case you should upgrade
or the soooo clever people at Fedora/Red Hat screwed something ;o)

My advice is that you should compile by yourself a perl 5.8.* source
archive taken from your local CPAN mirror and see what is how it behaves.

Have a nice day,
 
S

Stephen Quinney

AlV said:
Well, I tested your program with my different perl installations
(compiled by myself for different purposes):
Perl 5.6.1 : 4 seconds
Perl 5.8.0 : 4 seconds
Perl 5.8.4 : 4 seconds

My guess is either 5.8.3 was severely broken in case you should
upgrade or the soooo clever people at Fedora/Red Hat screwed something
;o)

Does that FC2 have SELinux turned on, in either mode? If so, that
might slow things down a bit. It'd be interesting to see the breakdown
of the total time into compile time and run time that might tell you
where the real problem lies. Do other things on the FC2 box run slowly
compared to the RH7.3 box? If so, I'd expect you've got a hardware
problem somewhere.

Stephen
 
J

Juha Laiho

(e-mail address removed) (Pablo S) said:
Run from bash on 2 redhat systems with the same hardware:

#!/usr/bin/perl
$start=time;
my $i=20000000;

while ($i) {
$i--;
}
print "Finished!". (time - $start);


Stock redhat 7.3: 3 seconds (5.6.1)
Stock FC2: 37 seconds (5.8.3)

I may be completely beating the bushes here, but could you be seeing
something related to use of locales? Also, it might be a good idea to
install current patches to the FC2 system (if not done already).

Old RedHats (pre-9.0) used to run using some locale with 8-bit charset.
Later releases default to using UTF-8 character set. What was visible
at least with RH9 was a huge slowdown of 'grep' (roughly half the speed),
and the speed was easily restored by changing LC_CTYPE to a 8-bit
character set.
 
P

Pablo S

Stephen Quinney said:
Does that FC2 have SELinux turned on, in either mode? If so, that
might slow things down a bit. It'd be interesting to see the breakdown
of the total time into compile time and run time that might tell you
where the real problem lies. Do other things on the FC2 box run slowly
compared to the RH7.3 box? If so, I'd expect you've got a hardware
problem somewhere.

Stephen

Hardware indeed. =/ After recompiling a no-frills perl and having
basically exactly the same result, I compiled a quick C program and
ran that on the 2 systems. Same performance disparity. Tracked it to
the motherboard. I will now benchmark every system I buy.

So looks like the new perl, even multithreaded, still has comparable
performance, at least for me, on a variety of platforms. It's great
news!

Thanks all for the input!

Pablo
 
T

Tore Aursand

After recompiling a no-frills perl and having basically exactly the same
result, I compiled a quick C program and ran that on the 2 systems.
Same performance disparity. Tracked it to the motherboard.

What motherboard is it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top