This is the mail archive of the gcc-patches@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: C++ PATCH to cp/decl.c: Timing name lookup


On Tuesday, February 11, 2003, at 06:16  AM, Gabriel Dos Reis wrote:

Hi,

  I've applied the patch below to gcc-3_3-branch for timing name
lookup.  Not all functions involved in name lookup issues have been
instrumented, but most of them are involved.  Forthcoming patches will
add some bits here and there.  Please, run the compiler with
-ftime-report and report what you think is interesting.
This is very exciting! You were right to think that name lookup was
a major culprit.

I'm going to give more complete numbers later, after I've massaged
some more statistics, but here's a start. I ran my usual first-cut
timing test: compiling structureparser.cpp at -O0, using the top of
3.3 branch as of this morning configured with --disable-checking.
On my 1.5GHz P4 Linux box, compilation of this file consistently
takes 4.2s wall clock time.

The exciting part: according to -ftime-report, 15 or 20% of the time is
spent in name lookup. That's huge!

--Matt


P.S. My numbers are varying from run to run, but here's some typical output from -ftime-report:

garbage collection : 1.24 (23%) usr 0.00 ( 0%) sys 1.38 (20%) wall
cfg construction : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
life info update : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
preprocessing : 0.37 ( 7%) usr 0.07 ( 6%) sys 0.88 (13%) wall
lexical analysis : 0.39 ( 7%) usr 0.15 (13%) sys 0.62 ( 9%) wall
parser : 2.31 (42%) usr 0.39 (34%) sys 2.75 (40%) wall
name lookup : 1.01 (18%) usr 0.49 (43%) sys 1.12 (16%) wall
varconst : 0.04 ( 1%) usr 0.02 ( 2%) sys 0.00 ( 0%) wall
jump : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
mode switching : 0.02 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
local alloc : 0.02 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
global alloc : 0.01 ( 0%) usr 0.01 ( 1%) sys 0.00 ( 0%) wall
shorten branches : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
final : 0.02 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
rest of compilation : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.12 ( 2%) wall
TOTAL : 5.48 1.14 6.88


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