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?


 > From: Anna Fowles-Winkler <awinkler at maad dot com>
 > 
 > 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).

Thanks for the info.  It sounds like you have a lot of files.  There
can be a significant overhead in simply having `make' check all the
dependencies, stat'ing files, etc, so it knows what to compile.  This
is especially true if every file depends on many (most? all?) of the
300 header files.  It gets much worse if you have split this into
subdirectories, then cd into directories and run another copy of make.
Someone (Zack?) once posted an article which explained why this is
very bad and changed gcc to avoid doing this.  I wish I could find it.

Anyway, if the files you listed are representative (as opposed to the
best ones) then the improvement is even better than I originally
thought.  The average "before" time is (2.88+3.83+2.98)/3 == 3.23 and
the average "after" time is (2.12+2.75+2.44)/3 == 2.44.  Dividing
3.23/2.44 we get a ratio of 1.323, i.e. better than when including
overall `make' time.

Thanks for all your testing!  Good luck with your app, I hope you find
GCC useful and fast enough for your needs.

		--Kaveh
--
Kaveh R. Ghazi			ghazi at caip dot rutgers dot edu


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