This is the mail archive of the gcc@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: Suggestions for improving gcc 3.2 compilation speed?


Kaveh R. Ghazi wrote:

> From: Anna Fowles-Winkler <awinkler at maad dot com>
> > Hi Kaveh,
> > Kaveh R. Ghazi wrote:
> > > > --Anna
> > > PS - My application is mixed C/C++, and is compiled with the C++ > > > compiler. It has about 300K lines of code (400K+ including comments, > > > blank lines), and links to Motif libraries, among other things.
> >
> >Would you please try one more thing? I'd like you to take your
> >largest file (or the one that takes the longest to compile) and run
> >before and after tests with --time-report, then post the results.
> >That will tell us where the compiler is spending it's time and also
> >zero in on gcc performance rather than "make" performance.
> >
> > Thanks,
> > --Kaveh
> >
> I'm doing a full compile when I do this, so I picked out the longest > execution times for a few files to include here:


Hmm Can't see anything unusual about where time is going.  These look
like all small files, i.e. 3-8 seconds to compile isn't a lot.  I
assume you have lots of small files rather than a few large ones?
By the way, which are "before" times and which are "after" the patch?

Ooops... I forgot to show the difference. A full compile of my application means that 593 *.C files are compiled (and there are about 300 header files, not including standard ones from C/C++ or X).

Here are some times for a few files, all compiled with gcc 3.2.2. I've noted the times with and without the patch that you sent.

dbObjectDB.C
------------

without patch:
Execution times (seconds)
garbage collection    :   0.47 (22%) usr   0.02 ( 7%) sys   0.59 (21%) wall
cfg cleanup           :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
preprocessing         :   0.20 ( 9%) usr   0.06 (20%) sys   0.31 (11%) wall
lexical analysis      :   0.13 ( 6%) usr   0.13 (43%) sys   0.20 ( 7%) wall
parser                :   0.93 (44%) usr   0.05 (17%) sys   1.05 (36%) wall
expand                :   0.03 ( 1%) usr   0.00 ( 0%) sys   0.02 ( 1%) wall
varconst              :   0.08 ( 4%) usr   0.02 ( 7%) sys   0.16 ( 5%) wall
mode switching        :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
local alloc           :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 1%) wall
global alloc          :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.08 ( 3%) wall
shorten branches      :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
final                 :   0.02 ( 1%) usr   0.01 ( 3%) sys   0.02 ( 1%) wall
symout                :   0.20 ( 9%) usr   0.01 ( 3%) sys   0.42 (15%) wall
rest of compilation   :   0.03 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
TOTAL                 :   2.12             0.30             2.88

with patch:
Execution times (seconds)
cfg construction      :   0.01 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
life analysis         :   0.01 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
preprocessing         :   0.18 (11%) usr   0.08 (26%) sys   0.25 (12%) wall
lexical analysis      :   0.22 (13%) usr   0.12 (39%) sys   0.38 (18%) wall
parser                :   0.84 (52%) usr   0.10 (32%) sys   1.12 (53%) wall
expand                :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
varconst              :   0.08 ( 5%) usr   0.00 ( 0%) sys   0.09 ( 4%) wall
local alloc           :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
reg stack             :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
final                 :   0.03 ( 2%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
symout                :   0.23 (14%) usr   0.00 ( 0%) sys   0.16 ( 7%) wall
TOTAL                 :   1.63             0.31             2.12

taskNewtorkModelDB.C
--------------------

without patch:
Execution times (seconds)
garbage collection    :   0.56 (20%) usr   0.00 ( 0%) sys   0.73 (19%) wall
cfg construction      :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
life analysis         :   0.03 ( 1%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
life info update      :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
preprocessing         :   0.23 ( 8%) usr   0.07 (19%) sys   0.31 ( 8%) wall
lexical analysis      :   0.17 ( 6%) usr   0.11 (30%) sys   0.41 (11%) wall
parser                :   1.10 (39%) usr   0.17 (46%) sys   1.56 (41%) wall
expand                :   0.03 ( 1%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
varconst              :   0.09 ( 3%) usr   0.01 ( 3%) sys   0.08 ( 2%) wall
integration           :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
jump                  :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
mode switching        :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
local alloc           :   0.04 ( 1%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall
global alloc          :   0.15 ( 5%) usr   0.00 ( 0%) sys   0.19 ( 5%) wall
shorten branches      :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall
reg stack             :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
final                 :   0.03 ( 1%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
symout                :   0.24 ( 9%) usr   0.01 ( 3%) sys   0.30 ( 8%) wall
rest of compilation   :   0.07 ( 2%) usr   0.00 ( 0%) sys   0.06 ( 2%) wall
TOTAL                 :   2.82             0.37             3.83

with patch:
Execution times (seconds)
cfg construction      :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.06 ( 2%) wall
life analysis         :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
life info update      :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
preprocessing         :   0.21 ( 9%) usr   0.13 (38%) sys   0.34 (12%) wall
lexical analysis      :   0.12 ( 5%) usr   0.05 (15%) sys   0.28 (10%) wall
parser                :   1.20 (54%) usr   0.12 (35%) sys   1.31 (48%) wall
expand                :   0.06 ( 3%) usr   0.00 ( 0%) sys   0.09 ( 3%) wall
varconst              :   0.06 ( 3%) usr   0.01 ( 3%) sys   0.06 ( 2%) wall
jump                  :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
mode switching        :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
local alloc           :   0.06 ( 3%) usr   0.00 ( 0%) sys   0.06 ( 2%) wall
global alloc          :   0.08 ( 4%) usr   0.01 ( 3%) sys   0.03 ( 1%) wall
flow 2                :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
shorten branches      :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
reg stack             :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
final                 :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
symout                :   0.23 (10%) usr   0.01 ( 3%) sys   0.19 ( 7%) wall
rest of compilation   :   0.09 ( 4%) usr   0.01 ( 3%) sys   0.16 ( 6%) wall
TOTAL                 :   2.23             0.34             2.75

task DB.C
---------

without patch:
Execution times (seconds)
garbage collection    :   0.46 (19%) usr   0.00 ( 0%) sys   0.50 (17%) wall
cfg construction      :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 1%) wall
cfg cleanup           :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 1%) wall
life analysis         :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.11 ( 4%) wall
life info update      :   0.03 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
preprocessing         :   0.16 ( 7%) usr   0.09 (33%) sys   0.17 ( 6%) wall
lexical analysis      :   0.16 ( 7%) usr   0.08 (30%) sys   0.27 ( 9%) wall
parser                :   0.94 (38%) usr   0.08 (30%) sys   1.16 (39%) wall
expand                :   0.08 ( 3%) usr   0.00 ( 0%) sys   0.08 ( 3%) wall
varconst              :   0.03 ( 1%) usr   0.00 ( 0%) sys   0.08 ( 3%) wall
integration           :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
jump                  :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
mode switching        :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
local alloc           :   0.06 ( 2%) usr   0.00 ( 0%) sys   0.08 ( 3%) wall
global alloc          :   0.17 ( 7%) usr   0.00 ( 0%) sys   0.19 ( 6%) wall
shorten branches      :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 1%) wall
final                 :   0.09 ( 4%) usr   0.01 ( 4%) sys   0.06 ( 2%) wall
symout                :   0.14 ( 6%) usr   0.01 ( 4%) sys   0.17 ( 6%) wall
rest of compilation   :   0.05 ( 2%) usr   0.00 ( 0%) sys   0.05 ( 2%) wall
TOTAL                 :   2.46             0.27             2.98

with patch:
Execution times (seconds)
cfg construction      :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
cfg cleanup           :   0.01 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
life analysis         :   0.03 ( 2%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
life info update      :   0.01 ( 1%) usr   0.01 ( 3%) sys   0.03 ( 1%) wall
preprocessing         :   0.12 ( 6%) usr   0.06 (18%) sys   0.19 ( 8%) wall
lexical analysis      :   0.18 ( 9%) usr   0.11 (32%) sys   0.19 ( 8%) wall
parser                :   0.91 (48%) usr   0.11 (32%) sys   1.12 (46%) wall
expand                :   0.06 ( 3%) usr   0.02 ( 6%) sys   0.09 ( 4%) wall
varconst              :   0.05 ( 3%) usr   0.01 ( 3%) sys   0.09 ( 4%) wall
integration           :   0.02 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
jump                  :   0.01 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
flow analysis         :   0.01 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
mode switching        :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
local alloc           :   0.08 ( 4%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
global alloc          :   0.11 ( 6%) usr   0.00 ( 0%) sys   0.16 ( 6%) wall
flow 2                :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
shorten branches      :   0.01 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
reg stack             :   0.01 ( 1%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
final                 :   0.07 ( 4%) usr   0.00 ( 0%) sys   0.03 ( 1%) wall
symout                :   0.16 ( 8%) usr   0.02 ( 6%) sys   0.31 (13%) wall
rest of compilation   :   0.04 ( 2%) usr   0.00 ( 0%) sys   0.06 ( 3%) wall
TOTAL                 :   1.91             0.34             2.44

Thanks!
Anna


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