public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Diego Novillo <dnovillo@google.com>
To: Steven Bosscher <stevenb.gcc@gmail.com>
Cc: GCC Mailing List <gcc@gcc.gnu.org>
Subject: Re: Where does the time go?
Date: Fri, 21 May 2010 20:43:00 -0000	[thread overview]
Message-ID: <AANLkTinaqVy3qL7qmtxO0PIQf5SDz8wK1HWnF0JlUVFr@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimYQASWjXGLX9W49v-1Sy3VsLIaybYWD2oTe808@mail.gmail.com>

Interesting.  Thanks for gathering this.

I did a similar study internally on our C++ codebase.  The results are
fairly different.  In our case, the front end takes a LARGE chunk of
the compile time.  The numbers below are taken from a full build of
one of our applications, consisting of ~4,500 C++ files.  These are
the aggregated times for an -O0 build (only the first 10 main
contributors shown):

TOTAL                  :  11583.19 cpu sec,   3705.69 sys sec,
16012.79 wall sec, 841456705 kB
parser                 :   6057.47 cpu sec,   1717.66 sys sec,
7955.42 wall sec, 580829675 kB
name lookup            :   1688.17 cpu sec,   1011.80 sys sec,
2750.34 wall sec,  93255238 kB
preprocessing          :    796.18 cpu sec,    575.73 sys sec,
1777.63 wall sec,  14743549 kB
tree |^ dominator      :   1067.33 cpu sec,    197.20 sys sec,
1290.34 wall sec, 101280196 kB
tree gimplify          :    973.18 cpu sec,    175.87 sys sec,
1172.88 wall sec,  96888948 kB
garbage collection     :    471.20 cpu sec,     22.20 sys sec,
499.94 wall sec,         0 kB
expand                 :    339.34 cpu sec,     39.46 sys sec,
386.19 wall sec,  17818728 kB
varconst               :    336.20 cpu sec,     45.11 sys sec,
383.70 wall sec,  10064103 kB
final                  :    111.79 cpu sec,     13.64 sys sec,
131.18 wall sec,    801421 kB

The front end (parser + name lookup + preprocessing) is taking 78% of
the wall clock time.  What was surprising is that this ratio is fairly
consistently maintained across three kinds of builds: optimized (-O2),
not optimized (-O0) and debug (-g -O0).

In an optimized build, the difference was that the front end reduced
its contribution from 78% to 70%.

In all cases, the gimplifier took about 6% of the total compile time.

For debug builds, the difference was a 6% of time taken by symout.

We are currently looking at ways of speeding up builds internally.
Based on this, we are mostly looking at ways of making the front end
faster.  This profile is fairly consistent across much of our code
base.



Diego.

  parent reply	other threads:[~2010-05-21 19:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20 15:55 Steven Bosscher
2010-05-20 19:16 ` Vladimir Makarov
2010-05-20 19:57   ` Toon Moene
2010-05-20 20:36   ` Steven Bosscher
2010-05-20 20:54     ` Duncan Sands
2010-05-20 21:14       ` Steven Bosscher
2010-05-23 19:09         ` Joseph S. Myers
2010-05-24 17:00           ` Mark Mitchell
2010-05-24 21:07             ` Steven Bosscher
2010-05-24 23:22               ` Mark Mitchell
2010-05-25  1:20                 ` Joseph S. Myers
2010-05-20 21:09     ` Ian Lance Taylor
2010-05-20 21:14       ` Xinliang David Li
2010-05-20 21:18         ` Steven Bosscher
2010-05-20 21:21           ` Xinliang David Li
2010-05-21 10:54             ` Richard Guenther
2010-05-21 13:26               ` Jan Hubicka
2010-05-21 15:06                 ` Richard Guenther
2010-05-21 15:49                   ` Jan Hubicka
2010-05-21 17:06               ` Xinliang David Li
2010-05-21 17:07                 ` Richard Guenther
2010-05-20 19:36 ` Joseph S. Myers
2010-05-20 20:35 ` Eric Botcazou
2010-05-20 20:42   ` Eric Botcazou
2010-05-21 20:43 ` Diego Novillo [this message]
2010-05-20 21:28 Bradley Lucier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinaqVy3qL7qmtxO0PIQf5SDz8wK1HWnF0JlUVFr@mail.gmail.com \
    --to=dnovillo@google.com \
    --cc=gcc@gcc.gnu.org \
    --cc=stevenb.gcc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).