This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Suggestions for improving gcc 3.2 compilation speed?
Benjamin Kosnik <bkoz at redhat dot com> writes:
> >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.
>
> Well....
>
> With Devang's patch I can do this, only I used std++.h.pch as "include
> all." I'm not quite sure what you mean by the "link it around under all the
> various names that can be used and fix the..." bits.
>
> However, still.
>
> baseline cvs, no pch
> 1031.380u 68.120s 23:47.94 76.9% 0+0k 0+0io 1687168pf+0w
>
> cvs with stamp-std-precompile, C++ includes as individual pch files
> 1005.580u 67.070s 23:43.49 75.3% 0+0k 0+0io 1678954pf+0w
>
> -include stdc++.h, stdc++.h.pch generated
> 1563.800u 103.100s 34:36.41 80.2% 0+0k 0+0io 1784752pf+0w
>
> #include stdc++.h, stdc++.h.pch generated
> 1017.940u 66.770s 24:34.06 73.5% 0+0k 0+0io 1684457pf+0w
>
> When I run the compiler with "-v -H" I get
>
> #include "..." search starts here:
> #include <...> search starts here:
> /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include
> /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu
> /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/backward
> /mnt/hd/src/gcc/libstdc++-v3/libsupc++
> /mnt/hd/src/gcc/libstdc++-v3/testsuite
> /mnt/hd/bld/gcc/gcc/include
> /usr/local/include
> /mnt/hd/bld/H-x86-gcc/include
> /usr/include
> End of search list.
> GNU C++ version 3.4 20030308 (experimental) (i686-pc-linux-gnu)
> compiled by GNU C version 3.4 20030308 (experimental).
> GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64154
>
> . /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/string
> .. /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/stdc++.h
> .. /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu/bits/c++config.h
>
> etc, etc, etc. Tell me if I'm doing something wrong, but I thought this
> was how it was supposed to work...
>
> This is with
>
> <bkoz at belmont> /mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include
> %ll stdc++.h.pch
> -rw-rw-r-- 1 bkoz bkoz 13M Mar 8 01:43 stdc++.h.pch
>
>
> Where stdc++.h includes all the C++ standard includes.
>
> Is the .pch just not being used?
It's possible.
You might want to check whether you're using a compiler that uses .pch
or .gch as the PCH extension.
Also, consider using the -Winvalid-pch flag.
--
- Geoffrey Keating <geoffk at geoffk dot org>