http://www.perlmonks.org?node_id=563988

jeteve has asked for the wisdom of the Perl Monks concerning the following question:

Hi wise monks,

I'm using the perl version that comes with my linux distribution. According to perl -V, it's compiled with debugging options.

I wonder if I should recompile a perl without those options to get better performances.

Maybe one of you had allready define the best compiles options to have the best perl performance. If so, it would be a great help to me !

Thanks for enlighting my darkness.

-- Nice photos of naked perl sources here !

Replies are listed 'Best First'.
Re: perl compile options
by hv (Prior) on Jul 27, 2006 at 09:37 UTC

    The runtime cost of a debugging-enabled perl varies depending on the sort of processing you're doing. Most of the time the cost is negligible, but in some cases it can be quite significant (eg if some debug variable is being malloced and released in a tight loop).

    I'd suggest building a non-debugging perl and doing some comparative benchmarks on your own programs to see if the difference would be significant in your case.

    Hugo

Re: perl compile options
by Hue-Bond (Priest) on Jul 27, 2006 at 09:10 UTC
    I wonder if I should recompile a perl without those options to get better performances

    If you aren't having performance problems, you shouldn't be worrying about that. It's a common mistake to try to enhance performance without a "real" reason to do it. Better waste your efforts in some other things, and worry about performance when it becomes a problem.

    --
    David Serrano

Re: perl compile options
by syphilis (Archbishop) on Jul 27, 2006 at 10:52 UTC
    I wonder if I should recompile a perl without those options to get better performances

    Being a fairly timid sort of fellow, I would just leave the perl that came with your OS as is. But I would also be compiling a non-debug version of perl, installing it into /usr/local/lib, and using it instead of /usr/lib/perl. IIRC (and according to my 'perl -V'), the only args I supply to Configure are '-des', and I have been quite happy with the results. Whether that suits you, however, depends upon what you want from your perl.

    Cheers,
    Rob
Re: perl compile options
by diotalevi (Canon) on Jul 27, 2006 at 14:08 UTC

    I'd just add that compiling in threading exerts a not insignificant runtime cost. If you never use threading having an unthreaded perl is nice.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Re: perl compile options
by vkon (Curate) on Jul 27, 2006 at 14:44 UTC
    I heard once that RedHat shipped once (or twice?) debugging perl with its Linux, this is just unfortunate.
    Whether or not recompile - graetly depends on many factors. What is your distribution?

    recompiling /usr/bin/perl will cause problems if some system tools depending on perl will modules that need recompilation.

    For example, from my own experience, after recompiling /usr/bin/perl on Mandrake 10.0 I got incompatible modules and many system tools indeed stop working.
    In this case better approach was to update Perl from distribution provided with same vendor (rpm package).

    Vadim.

A reply falls below the community's threshold of quality. You may see it by logging in.