On 2009-Jul-28 01:22:58 +0100, David Kirkby <david.kir...@onetel.net> wrote:
>I noticed that several packages build Sage with the -g option to ,
>which adds debugging information. This has 3 downsides
>
>1) The binaries are slower

gcc allows '-O -g' so the binaries shouldn't be slower when gcc is
used.  Some other C/C++ compilers don't allow optimisation with
debugging so debug versions would be slower there.

>2) The binaries are bigger

The filesize on disk is much larger (3-4 times is probably reasonable
for C/C++ code but it depends a lot on how much variable typing
information needs to be included - ie how heavily typedefs and structs
are used).  The debug information is not loaded into memory so the
RAM footprint is unchanged.

>3) Possibly takes longer to compile - I've not verified this, but I
>suspect it does.

The actual compilation time increases slightly as the compiler needs
to generate the debug information.  The wallclock time can increase
significantly due to all the extra file I/O.

Much of sage is not compiled using gcc (python etc) and this won't be
impacted by building the C code with debugging so the overall impact
will not be as severe.

>I think it would be a good idea to remove the -g flag in general. As
>far as I am aware, there is the SAGE_DEBUG variable, which should be
>set to 1 for debugging.

I tend to agree:  Keep in mind that the '-g' flag will only help with
debugging binary code - debugging the python/lisp/... code is
unaffected.

-- 
Peter Jeremy

Attachment: pgpJWu3YUnmCU.pgp
Description: PGP signature

Reply via email to