GCC 3.3 compile speed regression - AN ANSWER
Matt Austern
austern@apple.com
Wed Feb 12 19:51:00 GMT 2003
On Tuesday, February 11, 2003, at 11:52 PM, Joseph S. Myers wrote:
> On Tue, 11 Feb 2003, Matt Austern wrote:
>
>> All of my measurements suggest that improving the speed of
>> optimization
>> phases is irrelevant. What's slow is the front end: parsing and
>> semantic analysis. -O0 compilations are slow, not just -O3.
>
> The -fsyntax-only figures posted
> <http://gcc.gnu.org/ml/gcc/2003-02/msg00488.html> show it is not the
> front
> end; -O0 -fsyntax-only has become faster, while the time for
> unoptimized
> code generation (the time for -O0 minus that for -O0 -fsyntax-only) has
> doubled between 2.95 branch and mainline and the times to optimize have
> become worse as well.
We're obviously testing different things. For the kinds of compilations
where Apple is most concerned about speed, the back end is so far down
in the noise that using -fsyntax-only makes no important difference.
Here's
an example:
bash-2.05$ ~/root33/bin/g++ -S -ftime-report -O0 -DQT_NO_DEBUG
-DQT_SHARED -I/home/austern/qt-x11-free-3.1.1/mkspecs/linux-g++ -I.
-I/usr/include/freetype2 -I../../../include -I/usr/X11R6/include
-I/usr/X11R6/include -I.moc/release-shared/ structureparser.cpp
Execution times (seconds)
garbage collection : 1.30 (24%) usr 0.00 ( 0%) sys 1.38 (21%)
wall
cfg cleanup : 0.02 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
trivially dead code : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
preprocessing : 0.35 ( 6%) usr 0.21 (18%) sys 0.38 ( 6%)
wall
lexical analysis : 0.49 ( 9%) usr 0.20 (17%) sys 0.75 (11%)
wall
parser : 2.30 (42%) usr 0.31 (26%) sys 2.50 (38%)
wall
name lookup : 0.91 (17%) usr 0.43 (37%) sys 1.38 (21%)
wall
varconst : 0.02 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
branch prediction : 0.00 ( 0%) usr 0.01 ( 1%) sys 0.00 ( 0%)
wall
local alloc : 0.02 ( 0%) usr 0.00 ( 0%) sys 0.25 ( 4%)
wall
global alloc : 0.03 ( 1%) usr 0.00 ( 0%) sys 0.00 ( 0%)
wall
symout : 0.00 ( 0%) usr 0.01 ( 1%) sys 0.00 ( 0%)
wall
TOTAL : 5.47 1.17 6.62
bash-2.05$ ~/root33/bin/g++ -S -ftime-report -fsyntax-only -O0
-DQT_NO_DEBUG -DQT_SHARED
-I/home/austern/qt-x11-free-3.1.1/mkspecs/linux-g++ -I.
-I/usr/include/freetype2 -I../../../include -I/usr/X11R6/include
-I/usr/X11R6/include -I.moc/release-shared/ structureparser.cpp
Execution times (seconds)
garbage collection : 1.17 (21%) usr 0.01 ( 1%) sys 1.12 (16%)
wall
preprocessing : 0.37 ( 7%) usr 0.13 (10%) sys 0.75 (11%)
wall
lexical analysis : 0.33 ( 6%) usr 0.28 (21%) sys 0.75 (11%)
wall
parser : 2.40 (42%) usr 0.27 (20%) sys 2.88 (40%)
wall
name lookup : 1.04 (18%) usr 0.65 (48%) sys 1.25 (18%)
wall
varconst : 0.37 ( 7%) usr 0.02 ( 1%) sys 0.38 ( 5%)
wall
TOTAL : 5.69 1.36 7.12
In this example the -fsyntax-only run happens to be slower. That's not
always the case, but it illustrates my point: for this -O0 compilation,
the
time taken by the back end is smaller than the measurement error.
--Matt
More information about the Gcc
mailing list