100x -O0 Compile Time Regression {3.2,3.3} -> {3.4,3.5}

Jan Hubicka hubicka@ucw.cz
Fri Feb 13 11:26:00 GMT 2004


> Hello.
> 
> We've got some generated C++ which compiles in about 10s (on a P4 2800) at 
> -O0 with gcc-3.2 or 3.3.2,
> but takes about 1000s with 3.4.0 or 3.5.0.
> 
> -ftime-report says that the parser time has gone from 8.04s (gcc-3.3.2) to 
> 958.19s (gcc-3.4.0)
> 
> Any suggestions as to where to start digging ?  I can supply preprocessed 
> source to anyone interested.
> 
> The "-ftime-report -fmem-report" report for gcc-3.4.0 follows.
> 
> Regards,
> 
> John.

> Reading specs from /usr/local/gcc/gcc-3.4-cvs-20040212-0030/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
> Configured with: /home/jv/gcc/sources/gcc-3.4-cvs-20040212-0030/gcc/configure --disable-checking --prefix=/usr/local/gcc/gcc-3.4-cvs-20040212-0030 --host=i686-pc-linux-gnu --with-cpu=pentium3 --with-tune=pentium4 --enable-languages=c,c++ --enable-__cxa_atexit
> Thread model: posix
> gcc version 3.4.0 20040212 (prerelease)
>  /usr/local/gcc/gcc-3.4-cvs-20040212-0030/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1plus -quiet -v -I/home/jv/vtoc/scripts/regression/vtoc_builds/040107Wed-2355-gcc3.4.0-csml/cv3/vtoclibs/lib -I../VE -I../FE -I../TX -I../TBE -I../DZ_PSIU -I../PS_EU -D_GNU_SOURCE tb_c3d.cpp -quiet -dumpbase tb_c3d.cpp -mtune=pentium4 -auxbase-strip junk.o -version -ftime-report -fmem-report -o /tmp/ccvT59wQ.s
> ignoring nonexistent directory "/usr/local/gcc/gcc-3.4-cvs-20040212-0030/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/include"
> #include "..." search starts here:
> #include <...> search starts here:
>  /home/jv/vtoc/scripts/regression/vtoc_builds/040107Wed-2355-gcc3.4.0-csml/cv3/vtoclibs/lib
>  ../VE
>  ../FE
>  ../TX
>  ../TBE
>  ../DZ_PSIU
>  ../PS_EU
>  /usr/local/gcc/gcc-3.4-cvs-20040212-0030/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0
>  /usr/local/gcc/gcc-3.4-cvs-20040212-0030/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/i686-pc-linux-gnu
>  /usr/local/gcc/gcc-3.4-cvs-20040212-0030/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/backward
>  /usr/local/include
>  /usr/local/gcc/gcc-3.4-cvs-20040212-0030/include
>  /usr/local/gcc/gcc-3.4-cvs-20040212-0030/lib/gcc/i686-pc-linux-gnu/3.4.0/include
>  /usr/include
> End of search list.
> GNU C++ version 3.4.0 20040212 (prerelease) (i686-pc-linux-gnu)
> 	compiled by GNU C version 3.4.0 20040212 (prerelease).
> GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=126763
> Memory still allocated at the end of the compilation process
> Size   Allocated        Used    Overhead
> 8            192k        188k       4416 
> 16           248k        246k       3720 
> 32           140k        138k       1540 
> 64          6632k       6630k         58k
> 128         4096         896          32 
> 256          140k        138k        980 
> 512          100k         97k        700 
> 1024          72k         71k        504 
> 2048          68k         66k        476 
> 4096         248k        248k       1736 
> 8192         328k        328k       1148 
> 16384        176k        176k        308 
> 32768        512k        512k        448 
> 65536        256k        256k        112 
> 131072        128k        128k         28 
> 262144        256k        256k         28 
> 108           25M         24M        201k
> 20           157M        156M       2044k
> 24          2768k       2754k         32k
> 12          3808k       3803k         63k
> 40          1240k       1231k         12k
> Total        199M        198M       2428k
> 
> String pool
> entries		103124
> identifiers	103124 (100.00%)
> slots		262144
> bytes		2596k (119k overhead)
> table size	1024k
> coll/search	0.6805
> ins/search	0.3566
> avg. entry	25.79 bytes (+/- 13.83)
> longest entry	630
> 
> ??? tree nodes created
> 
> (No per-node statistics)
> Type hash: size 2039, 1274 elements, 1.184290 collisions
> no search statistics
> 
> Execution times (seconds)
>  cfg construction      :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall
>  cfg cleanup           :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall
>  trivially dead code   :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall
>  life analysis         :   0.04 ( 0%) usr   0.00 ( 0%) sys   0.08 ( 0%) wall
>  life info update      :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall
>  register scan         :   0.02 ( 0%) usr   0.00 ( 0%) sys   0.05 ( 0%) wall
>  preprocessing         :   0.43 ( 0%) usr   0.21 ( 1%) sys   3.37 ( 0%) wall
>  parser                : 958.19 (98%) usr   5.19 (36%) sys1618.27 (97%) wall
>  name lookup           :  17.34 ( 2%) usr   8.95 (62%) sys  45.47 ( 3%) wall

This looks like you get a lot of swapping.  I have patch to get some
statistics about who is allocating the memory, so please just forward
preprocessed file to my address and i will try it out, perhaps I will be
lucky :)

Honza
>  expand                :   0.11 ( 0%) usr   0.00 ( 0%) sys   0.21 ( 0%) wall
>  varconst              :   0.00 ( 0%) usr   0.01 ( 0%) sys   0.21 ( 0%) wall
>  integration           :   0.02 ( 0%) usr   0.00 ( 0%) sys   0.05 ( 0%) wall
>  local alloc           :   0.06 ( 0%) usr   0.00 ( 0%) sys   0.11 ( 0%) wall
>  global alloc          :   0.19 ( 0%) usr   0.01 ( 0%) sys   0.36 ( 0%) wall
>  flow 2                :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall
>  shorten branches      :   0.03 ( 0%) usr   0.00 ( 0%) sys   0.07 ( 0%) wall
>  final                 :   0.03 ( 0%) usr   0.00 ( 0%) sys   0.05 ( 0%) wall
>  rest of compilation   :   0.03 ( 0%) usr   0.00 ( 0%) sys   0.08 ( 0%) wall
>  TOTAL                 : 976.53            14.38          1669.15
> # cc1plus 976.53 14.39
>  as -V -Qy -o junk.o /tmp/ccvT59wQ.s
> GNU assembler version 2.13.90.0.2 (i386-redhat-linux) using BFD version 2.13.90.0.2 20020802
> # as 0.04 0.01
> 976.57user 14.40system 27:49.35elapsed 59%CPU (0avgtext+0avgdata 0maxresident)k
> 0inputs+0outputs (1447major+55533minor)pagefaults 0swaps



More information about the Gcc mailing list