This is the mail archive of the 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: Precompiled Header support for GCC-3.4

Hi Mike,

     Thanks for replying. Basically I am using auto tools to build my
project. I am referring to each of directory in my project suite as a

For ex. for testing I have created a library out of CPPUnit.   All the
source files of CPPUnit reside in a directory named CPPUnit. I am
referring to each directory as a module. I am referring to a .cpp file
as a source file and .h file as a header file.CPPUnit module contains
11 source files and 15 header files. Similary I have got other 3

Module 2 contains 18 source files and 24 header files. Module 3
contains 26 source files and 47 header files. Module 4 contains 296
source files and 259 header files.

First I compiled all the 4 modules without PCH support. Build time
was: 14 Min. 49 Sec.

Then I tried to include all the header files of all the modules into a
single header file create a PCH and compiled. Build time was: 20min.
2sec.  It was much slower than without PCH support.

Then I selected few of the files which are used by all the modules and
created PCH out of it. Build time was: 13min. 34sec.

Then a created a module specifiic header file and compiled with PCH
support. Build time was: 13min 28sec.

There is not significant decrease build time because of PCH support.
One thing I observed is that as the no. of header files included in
each of PCH goes on increasing build time also increases. I think its
supposed to happen in the other way. I don't understand this. Is there
anything wrong with the way I am trying out the things? Or any of the
compiler flags is missing?

Currently I am using following compiler flags for compilation.

g++ -DHAVE_CONFIG_H -I. -I. -I.. -include ../PCH/cppunitincludes.h 
-I../STL/stlport     -g -O2 -D_REENTRANT -DSLEXT='".so"' -DREDHAT9
-I/opt/sfw/include -D_DEBUG -Wall -DLINUX -fPIC -DPIC  -c -o

Thanks and Regards

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