Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

perl compile options

by jeteve (Pilgrim)
on Jul 27, 2006 at 08:58 UTC ( #563988=perlquestion: print w/replies, xml ) Need Help??
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 (Parson) 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.


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 (Chancellor) 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.

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).


Re: perl compile options
by madtoperl (Pilgrim) on Jul 27, 2006 at 09:10 UTC
    Hi jeteve,

    If you want to compile witout debugging,you can use perl -c <>

    Thanks and Regards,

      Er, no. What he meant was that when the perl was built the DEBUGGING symbol was defined which causes extra code to be compiled in perl to support the -D command-line switch. This can't be turned off at runtime.


      G:\>perl -h Usage: C:\Perl\bin\perl.exe [switches] [--] [programfile] [arguments] ... -c check syntax only (runs BEGIN and CHECK blocks) ...

      holli, /regexed monk/

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://563988]
Approved by holli
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2018-06-20 21:36 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.