This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Understanding the output of -ftime-report


On Wed, Aug 7, 2013 at 8:27 AM, Mathias Gaunard
<mathias.gaunard@ens-lyon.org> wrote:
>
> I'm trying to understand what each entry in -ftime-report means so that I
> can better optimize my C++ code for compilation code.
>
> What I currently have is attached.
>
> What do each of the high entries correspond to (phase generate, parser
> struct body, ...), and why could they be so high?
> Also which entries are subparts of others? Adding every percentage gives way
> more than 100%.

The times that start with "phase" are the different phases of the
compiler.  Ideally all the "phase" times should add up to 100%.  In
your case they clearly don't.  I think that was cleaned up somewhat in
the 4.8 release.

The times that start with '|' are run in conjunction with other
timers.  Ignore those when adding up numbers.

The other times are the times of specific passes.

In general you can't really make sense of the -ftime-report output
unless you look at the compiler source code.  Look at timevar.def for
the various timers, and look for timevar_start and timevar_stop to see
what they are measuring.

When it comes to changing your C++ code to speed up compilation time,
the most useful thing you can do is minimize header file inclusion.
Next, stop using templates.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]