Fastest versions of perl?

Discussion in 'Perl Misc' started by Pablo S, Sep 1, 2004.

  1. Pablo S

    Pablo S Guest

    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!
    Pablo S, Sep 1, 2004
    #1
    1. Advertising

  2. Pablo S

    AlV Guest

    Pablo S wrote:
    > 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,
    AlV, Sep 1, 2004
    #2
    1. Advertising

  3. AlV <> writes:

    > Pablo S wrote:
    >> 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)


    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
    Stephen Quinney, Sep 1, 2004
    #3
  4. Pablo S

    Juha Laiho Guest

    (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.
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
    Juha Laiho, Sep 1, 2004
    #4
  5. Pablo S

    Pablo S Guest

    Stephen Quinney <> wrote in message news:<>...
    > AlV <> writes:
    >
    > > Pablo S wrote:
    > >> 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)

    >
    > 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
    Pablo S, Sep 1, 2004
    #5
  6. Pablo S

    Tore Aursand Guest

    On Wed, 01 Sep 2004 13:19:45 -0700, Pablo S wrote:
    > 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?


    --
    Tore Aursand <>
    "What we anticipate seldom occurs. What we least expected generally
    happens." (Benjamin Disraeli)
    Tore Aursand, Sep 1, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bryan Krone

    perl efficiency -- fastest grepping?

    Bryan Krone, Nov 5, 2004, in forum: Perl
    Replies:
    1
    Views:
    1,464
    Jim Gibson
    Nov 8, 2004
  2. Michael J. Astrauskas

    Fastest Perl Interpreter

    Michael J. Astrauskas, Oct 25, 2003, in forum: Perl Misc
    Replies:
    14
    Views:
    237
    Steve Koppelman
    Nov 20, 2003
  3. Bryan Krone

    perl efficiency -- fastest grepping?

    Bryan Krone, Nov 16, 2004, in forum: Perl Misc
    Replies:
    5
    Views:
    135
    Uri Guttman
    Nov 16, 2004
  4. Seth Brundle
    Replies:
    4
    Views:
    424
    A. Sinan Unur
    Sep 22, 2005
  5. garey
    Replies:
    3
    Views:
    153
    Joe Smith
    May 29, 2007
Loading...

Share This Page