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: C++ compile and execution times


> > - recent versions of gcc take more than twice as long to compile the 
> >   library than, for example, gcc2.95 or icc;
> > - yet, the run time (with various optimizations turned on) of the 
> >   example programs of deal.II is approximately 10% longer.
> 
> I'd be interested in seeing -ftime-report comparisons for
> representative files, or even profiling data if you can swing it.

The first I can give (see below). In summary, garbage collection, expand,
and loop analysis become slower, but it's not that one part is entirely
dominating. I think the latter I leave to those with more experience (also
experience what to look for).

> Assuming I can schedule it, I intend to do quite a bit of work  on
> compilation speed for 3.4.

I would certainly not be the only one to appreciate that!

Regards
  Wolfgang


Result for a typical file, using gcc3.2.1-pre
---------------------------------------------
/home/bangerth/bin/gcc-3.2.1-pre/bin/g++ -DHAVE_CONFIG_H -DHAVE_ISNAN  -O2 
-Wuninitialized -felide-constructors -ftemplate-depth-32 -funroll-loops 
-funroll-all-loops -fstrict-aliasing  
-I/home/bangerth/p/deal.II/2/deal.II/base/include 
-I/home/bangerth/p/deal.II/2/deal.II/lac/include 
-I/home/bangerth/p/deal.II/2/deal.II/deal.II/include 
-I/home/bangerth/p/deal.II/2/deal.II/contrib/hsl/include -ftime-report 
-fPIC -Ddeal_II_dimension=2 -c source/grid/x.cc -o 
/home/bangerth/p/deal.II/2/deal.II/lib/2d/x_2d.o

Execution times (seconds)
 garbage collection    :  25.74 (15%) usr   0.06 ( 3%) sys  25.83 (15%) wall
 cfg construction      :   2.38 ( 1%) usr   0.04 ( 2%) sys   2.51 ( 1%) wall
 cfg cleanup           :   2.56 ( 2%) usr   0.00 ( 0%) sys   2.59 ( 1%) wall
 life analysis         :   8.07 ( 5%) usr   0.07 ( 4%) sys   8.29 ( 5%) wall
 life info update      :   1.25 ( 1%) usr   0.01 ( 1%) sys   1.27 ( 1%) wall
 preprocessing         :   0.64 ( 0%) usr   0.10 ( 5%) sys   1.34 ( 1%) wall
 lexical analysis      :   1.14 ( 1%) usr   0.24 (12%) sys   1.49 ( 1%) wall
 parser                :  14.63 ( 9%) usr   0.26 (13%) sys  14.99 ( 9%) wall
 expand                :  16.09 ( 9%) usr   0.10 ( 5%) sys  16.62 (10%) wall
 varconst              :   0.64 ( 0%) usr   0.04 ( 2%) sys   0.70 ( 0%) wall
 integration           :   3.72 ( 2%) usr   0.04 ( 2%) sys   3.82 ( 2%) wall
 jump                  :   2.67 ( 2%) usr   0.04 ( 2%) sys   2.77 ( 2%) wall
 CSE                   :  28.57 (17%) usr   0.05 ( 3%) sys  29.09 (17%) wall
 global CSE            :   3.09 ( 2%) usr   0.03 ( 2%) sys   3.10 ( 2%) wall
 loop analysis         :   7.94 ( 5%) usr   0.34 (17%) sys   8.23 ( 5%) wall
 CSE 2                 :  10.45 ( 6%) usr   0.02 ( 1%) sys  10.68 ( 6%) wall
 flow analysis         :   1.19 ( 1%) usr   0.00 ( 0%) sys   1.22 ( 1%) wall
 combiner              :   4.34 ( 3%) usr   0.01 ( 1%) sys   4.44 ( 3%) wall
 if-conversion         :   0.24 ( 0%) usr   0.01 ( 1%) sys   0.27 ( 0%) wall
 regmove               :   1.50 ( 1%) usr   0.00 ( 0%) sys   1.54 ( 1%) wall
 mode switching        :   0.53 ( 0%) usr   0.00 ( 0%) sys   0.55 ( 0%) wall
 scheduling            :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall
 local alloc           :   3.90 ( 2%) usr   0.07 ( 4%) sys   3.98 ( 2%) wall
 global alloc          :   7.33 ( 4%) usr   0.02 ( 1%) sys   7.46 ( 4%) wall
 reload CSE regs       :   4.80 ( 3%) usr   0.00 ( 0%) sys   4.73 ( 3%) wall
 flow 2                :   1.31 ( 1%) usr   0.01 ( 1%) sys   1.30 ( 1%) wall
 if-conversion 2       :   0.07 ( 0%) usr   0.00 ( 0%) sys   0.08 ( 0%) wall
 peephole 2            :   1.00 ( 1%) usr   0.02 ( 1%) sys   1.04 ( 1%) wall
 rename registers      :   2.53 ( 1%) usr   0.02 ( 1%) sys   2.58 ( 1%) wall
 scheduling 2          :   5.67 ( 3%) usr   0.12 ( 6%) sys   5.94 ( 3%) wall
 reorder blocks        :   0.44 ( 0%) usr   0.00 ( 0%) sys   0.45 ( 0%) wall
 shorten branches      :   0.71 ( 0%) usr   0.01 ( 1%) sys   0.72 ( 0%) wall
 reg stack             :   0.06 ( 0%) usr   0.00 ( 0%) sys   0.05 ( 0%) wall
 final                 :   1.87 ( 1%) usr   0.22 (11%) sys   2.06 ( 1%) wall
 symout                :   0.04 ( 0%) usr   0.02 ( 1%) sys   0.05 ( 0%) wall
 rest of compilation   :   3.05 ( 2%) usr   0.00 ( 0%) sys   3.13 ( 2%) wall
 TOTAL                 : 170.18             1.97           174.91

real    3m1.257s
user    2m56.140s
sys     0m2.150s



And with today's gcc3.3 (--disable-checking)

/home/bangerth/bin/gcc-3.3y-pre/bin/g++ -DHAVE_CONFIG_H -DHAVE_ISNAN  -O2 -Wunin
itialized -felide-constructors -ftemplate-depth-32 -funroll-loops -funroll-all-l
oops -fstrict-aliasing  -I/home/bangerth/p/deal.II/2/deal.II/base/include -I/hom
e/bangerth/p/deal.II/2/deal.II/lac/include -I/home/bangerth/p/deal.II/2/deal.II/
deal.II/include -I/home/bangerth/p/deal.II/2/deal.II/contrib/hsl/include -ftime-
report -fPIC -Ddeal_II_dimension=2 -c source/grid/x.cc -o /home/bangerth/p/deal.
II/2/deal.II/lib/2d/x_2d.o

Execution times (seconds)
 garbage collection    :  38.81 (18%) usr   0.09 ( 2%) sys  41.38 (17%) wall
 cfg construction      :   1.51 ( 1%) usr   0.02 ( 0%) sys   1.61 ( 1%) wall
 cfg cleanup           :   4.27 ( 2%) usr   0.14 ( 2%) sys   4.59 ( 2%) wall
 trivially dead code   :   4.19 ( 2%) usr   0.02 ( 0%) sys   4.37 ( 2%) wall
 life analysis         :   7.78 ( 4%) usr   0.03 ( 1%) sys   8.23 ( 3%) wall
 life info update      :   2.50 ( 1%) usr   0.00 ( 0%) sys   2.55 ( 1%) wall
 preprocessing         :   0.66 ( 0%) usr   0.25 ( 4%) sys   3.79 ( 2%) wall
 lexical analysis      :   1.40 ( 1%) usr   0.22 ( 4%) sys   1.56 ( 1%) wall
 parser                :  16.82 ( 8%) usr   0.51 ( 9%) sys  17.89 ( 7%) wall
 expand                :  24.78 (11%) usr   0.43 ( 7%) sys  26.59 (11%) wall
 varconst              :   0.68 ( 0%) usr   0.04 ( 1%) sys   0.81 ( 0%) wall
 integration           :   4.38 ( 2%) usr   0.10 ( 2%) sys   4.83 ( 2%) wall
 jump                  :   2.71 ( 1%) usr   0.18 ( 3%) sys   2.98 ( 1%) wall
 CSE                   :  27.22 (13%) usr   0.27 ( 5%) sys  29.73 (12%) wall
 global CSE            :   6.04 ( 3%) usr   0.09 ( 2%) sys   6.53 ( 3%) wall
 loop analysis         :  12.96 ( 6%) usr   2.22 (37%) sys  16.53 ( 7%) wall
 CSE 2                 :  10.47 ( 5%) usr   0.08 ( 1%) sys  11.45 ( 5%) wall
 branch prediction     :   4.63 ( 2%) usr   0.01 ( 0%) sys   5.05 ( 2%) wall
 flow analysis         :   0.81 ( 0%) usr   0.08 ( 1%) sys   0.93 ( 0%) wall
 combiner              :   4.88 ( 2%) usr   0.05 ( 1%) sys   5.19 ( 2%) wall
 if-conversion         :   0.46 ( 0%) usr   0.00 ( 0%) sys   0.47 ( 0%) wall
 regmove               :   1.64 ( 1%) usr   0.00 ( 0%) sys   1.73 ( 1%) wall
 mode switching        :   0.68 ( 0%) usr   0.01 ( 0%) sys   0.72 ( 0%) wall
 local alloc           :   4.25 ( 2%) usr   0.08 ( 1%) sys   4.50 ( 2%) wall
 global alloc          :   8.41 ( 4%) usr   0.08 ( 1%) sys   9.11 ( 4%) wall
 reload CSE regs       :   5.07 ( 2%) usr   0.10 ( 2%) sys   5.47 ( 2%) wall
 flow 2                :   1.14 ( 1%) usr   0.03 ( 1%) sys   1.24 ( 1%) wall
 if-conversion 2       :   0.17 ( 0%) usr   0.00 ( 0%) sys   0.21 ( 0%) wall
 peephole 2            :   0.70 ( 0%) usr   0.00 ( 0%) sys   0.71 ( 0%) wall
 rename registers      :   2.70 ( 1%) usr   0.09 ( 2%) sys   3.02 ( 1%) wall
 scheduling 2          :   6.37 ( 3%) usr   0.33 ( 6%) sys   7.20 ( 3%) wall
 reorder blocks        :   0.07 ( 0%) usr   0.00 ( 0%) sys   0.12 ( 0%) wall
 shorten branches      :   0.80 ( 0%) usr   0.06 ( 1%) sys   0.93 ( 0%) wall
 reg stack             :   0.08 ( 0%) usr   0.01 ( 0%) sys   0.09 ( 0%) wall
 final                 :   2.14 ( 1%) usr   0.21 ( 4%) sys   2.93 ( 1%) wall
 symout                :   0.06 ( 0%) usr   0.02 ( 0%) sys   0.09 ( 0%) wall
 rest of compilation   :   3.42 ( 2%) usr   0.08 ( 1%) sys   3.83 ( 2%) wall
 TOTAL                 : 215.68             5.94           239.05

real    4m6.232s
user    3m41.910s
sys     0m6.190s



-------------------------------------------------------------------------
Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth




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