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]

Re: Pre-compiled headers


Zack Weinberg wrote:
> 
> So, Cygnus has contracted me to implement
precompiled headers.

I don't think anyones mentioned it yet, but what about
the SGI C++ (and presumably C but I never used it)
approach. It generates a .pch file for each source
file. If source files include the same files it shares
the .pch file between them. It also provides a #pragma
to say stop putting header files in the .pch. This
means that you can put all the common headers before
the #pragma an only a few .pch's will be generated.
This means you get two time savings - one for between
source files and between builds (if the headers
haven't changed. The header dependencies are handled
automatically by the compiler and so it means you
actually don't need to handle the dependcies in the
Makefile.

When we used .pch's we got a significant speed up.
This was for a few reasons. The first was that we had
some really large header files include in lots of
source files. These files defined about a 100 classes
(Don't worry I have since changed this as it was
initially put in place before I started on the
project) and precompiling them once for the whole
build meant a huge speed up. The other speed up is
becuase processing of the headers involved processing
templates and the same
tepmlates were processed multiple times.

I'm not sure what information is stored in the files
the basic user interface was quite nice

James Briggs
_______________________________________________________________
Have you tried Yahoo! Australia & NZ Shopping - http://au.shopping.yahoo.com

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