Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Is your Perl running as fast as possible?

by zentara (Cardinal)
on Oct 17, 2005 at 12:54 UTC ( [id://500710]=perlmeditation: print w/replies, xml ) Need Help??

After recent motherboard and dsl upgrades, I have been able to quickly download linux-iso images and test out many different linux distributions. Anyways, I came across a run-time-speed difference between distros. I mention it here, just to raise awareness, and get comments as to why it occurs.

I was just testing my tk-tv-guide program ztk-tvguide on each distro, and was surprised to find that on OpenSuSE it took nearly 25 seconds to process a 1 meg xml file, whearas on my homebrew self-compiled slackware based system, it only took 5 seconds.

So I'm wondering why? Now, the perl I'm using on Slackware is a self-compiled 5.8.6 with threads-support. The Perl that comes default with OpenSuSE is 5.8.7 with threads-support.

Now I know there has to be a reason, which probably isn't as important as the point...... is your Perl version running as fast as it could/should?


I'm not really a human, but I play one on earth. flash japh
  • Comment on Is your Perl running as fast as possible?

Replies are listed 'Best First'.
Re: Is your Perl running as fast as possible?
by Courage (Parson) on Oct 17, 2005 at 14:15 UTC
    among things discussed on p5p, I remember it was mentioned that some RedHat distributions go with DEBUG-enabled builds of perl, which is rather sad.

    In order to get faster build, I tend to turn OFF threading support, which is bad in Perl anyways, and, secondly, I tend to use Perl's memory allocator, which, in turn, is quite a helper and is seemingly better than Tcl's allocator (so when I manage for both Perl and Tcl to use Perl's memory allocator, I see some additional speedup)

    As for dramatic speed improvements, related to your XML parsing, it is quite possible for Perl to use or not use Pure-perl and XS parts of module, so check whether your slower installation lacks some binary module.
    You may even copy perl between different OSes and see if this result in differences

    As a final note, Tcl::Tk is twice faster compared to Perl/Tk

      among things discussed on p5p, I remember it was mentioned that some RedHat distributions go with DEBUG-enabled builds of perl, which is rather sad.
      What's bad about running a debug enabled perl? Are you worried about a microscopic increase in the size of the perl binary caused by debugging symbols? Is there something else I should be aware of?
        It's a little slower. Compiling for threads make it a lot slower.
Re: Is your Perl running as fast as possible?
by samizdat (Vicar) on Oct 17, 2005 at 13:05 UTC
    One of the things I remember from Slackware (years ago when it was propped up^H^H^H^H^H^H^H^H^H^Hsupported by WC-CDROM) was that the ways to tweak the kernel were very well documented, far more so than any other aspect of the code.

    What are the kernel levels of each build you are using? How many LKM's are installed in the OpenSuSe? Is OpenSuSe set up for 16-bit characters by default?
Re: Is your Perl running as fast as possible?
by perrin (Chancellor) on Oct 17, 2005 at 19:20 UTC
    There are many potential reasons for this, like what else is running on your Suse machine. It sounds like maybe more of a disk I/O issue to me than pure Perl speed.

    If you're looking for speed tweaks, compiling without threads seems to be good for about a 15% improvement on Red Hat, and using a more optimizing compiler like the Intel one is also good for 10% or so.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://500710]
Approved by samizdat
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-12-08 00:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (50 votes). Check out past polls.