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 Saturday, March 8, 2003, at 12:20 AM, Benjamin Kosnik wrote:
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.

old .h contents:


map:
[ contents of map ]

list:
[ contents of list ]

new scheme:

map:
#include <all>
list:
#include <all>

all:
#include <old_map>
#include <old_list>

old_map:
[ contents of map ]

old_list:
[ contnets of list ]

and then precompile all, then ln all.gch map.gch; ln all.gch list.gch. Total disk space, sizeof(all) + just a little overhead * number of files in the C++ standard. Benefit can be made to kick in for any source files that are like:

#include <all>
[ ... ]

or
#include <map>

or
#include <list>

and the benefits extend through to all standard C++ headers, for example:

#include <list>
#include "myproject"
#include <map>

has cost of mmap (all) + groking (myproject), that's it. Currently, it has cost groking (list) + groking (myproject) + groking (map).

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

I suspect this isn't using PCH! Only absolute names work currently?!


try -include `pwd`/stdc++.h or whatever the dir is.

#include stdc++.h, stdc++.h.pch generated
1017.940u 66.770s 24:34.06 73.5%        0+0k 0+0io 1684457pf+0w

This looks better? Not sure, as it is only 1-2 seconds faster than the first.


I think -v should say if a pch file is used, otherwise, it is hard to tell when the mechanism kicks in, well, unless you have a huge .h file and you know exactly how long it takes to parse, and mmap. Wanna put a fprintf (stderr, "PCH file %s being used\n", name); in cpp_read_state? I think that will make it easy for the user to understand when PCH is used, and more importantly, to spot when it isn't being used.


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