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?


On Friday, March 7, 2003, at 11:12 AM, Benjamin Kosnik wrote:
I have a g++ compiler that is 5.6x faster than the current g++ when
compiling large C++ code bases. That's when compared to a g++ PCH,
without it, more like 8x to 16x faster when PCH isn't used.

Your PCH numbers are interesting to me.


I cannot get PCH to work with g++. How are you able to do this? Are you
generating individual .pch files for each header (don't see any
significant speed improvement), or are you using -include
big_globbed_header.h.pch (and if so, can you port the patches to do this
to mainline g++, because it currently doesn't work), or is there another
approach?

We use -include. We generate one large application .gch file that include tons of things in it.


bash-2.05a$ wc MillenniumFE.ii
  152201  333117 4298858 MillenniumFE.ii

That is the .ii file of the file that is -included. This generates a 30-40 MB .gch file. The application has 279 translation units in it.

I don't know offhand why it works for us and not you. Random guess, I thought I saw something about TAKES_ARG go by recently in another context... Found it, in cppspec.c Devang added DEFFAULT_WORD_TAKES_ARG, is this related to why -include doesn't work?

The best win I can think of for g++ would be to create all, and include all the headers one can, and change all headers to inlcude all, and then precompile all, and link it around under all the various names that can be used and fix the can't do more than abs names problem in PCH.

This doesn't rely upon -include, works out of the box for all the std include files, maximal win, easy to use, just #include one of the normal C++ headers before anything else in the .cc files.


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