This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Precompiled Header support for GCC-3.4
- From: Prasad Kulkarni <prasad dot vk at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 9 Sep 2004 17:36:48 +0530
- Subject: Precompiled Header support for GCC-3.4
- Reply-to: Prasad Kulkarni <prasad dot vk at gmail dot com>
Hi ,
I was just trying my hand at precompiled header support provided by
gcc 3.4. In one my project I have got 4 modules. Modules 1 and 2 are
relatively small where as 3 and 4 are large. I included all the
files needed by modules1 and 2 into a single header file and generated
a PCH for it. When I compiled them with the support of PCH I found
considerable speed in build time.
But for modules 3 and 4 it didn't work. As these are large modules
no. of header files needed are quite high. When I generated a single
PCH and compiled it took larger amount of time than the one without
PCH. (1.5 times slower). Also the size of PCH file was very large.
Then I reduced the no. of files and kept only those which are used by
most of translational units build time was faster. But there is only
slilght decrease in build time compared to one without PCH support.
Then I generated one PCH each of translational unit. Still its build
time higher than the one without PCH.
Can anybody please enlighten me about the logic behind this? If I
have lots of header files for a module and want decrease the build
time of module is PCH right thing to go? If yes, then how I can do it?
Also is there any special flags are there that I need to add or omit
while compilation that may effect my build time considerably? Are
there any any special configuration options that I need to specify
while building gcc itself to take complete advantage of PCH?
Thanks and Regards
--Prasad