This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How does the gcc -g option affect performance?
- From: Brian Budge <brian dot budge at gmail dot com>
- To: Vishnu Mahadevan Menon <vishnu_m_menon at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 3 Mar 2005 15:19:20 +0100
- Subject: Re: How does the gcc -g option affect performance?
- References: <20050303140521.57843.qmail@web42205.mail.yahoo.com>
- Reply-to: Brian Budge <brian dot budge at gmail dot com>
Yes, there's a large performance penalty. (1) most optimizations
can't be done because they foo with the debug data, thereby hurting
debuggability (2) bloated code is slow code.
Normally I expect my code to run about an order of magnitude slower with -g.
Brian
On Thu, 3 Mar 2005 06:05:21 -0800 (PST), Vishnu Mahadevan Menon
<vishnu_m_menon@yahoo.com> wrote:
> Hi,
>
> Could someone please help me with the following?
>
> According to the gcc man page, the -g option "produces
> debugging information in the operating system's native
> format".
>
> Does anyone know what kind "debugging information" gcc
> produces with the -g option? The binary evidently gets
> bloated, but does gcc actually generate extra
> executable code, or does it merely add static
> information on symbols, lines etc.? Most importantly,
> apart from issues caused by large program size, is
> there a performance penalty to be paid for programs
> compiled using -g?
>
> Thanks in advance!
>
> Regards,
> Vishnu.
>
>
> __________________________________
> Celebrate Yahoo!'s 10th Birthday!
> Yahoo! Netrospective: 100 Moments of the Web
> http://birthday.yahoo.com/netrospective/
>