patch - pch support for unix/gcc builds

From: Robert Staudinger <robert.staudinger_at_gmail.com>
Date: Fri Sep 09 2005 - 12:57:37 CEST

Hi,

the patch is here:
http://www.abisource.com/~rob/tmp/abi-gcc-pch.diff

Below i'm pasting the contents of a readme included in the patch.

I'm not sure how to benchmarks real-world rebuilds to evaluate the
usefulness of PCHs. Maybe i could create a "rebuild-abi.sh" script
that times the run (using pch/non-pch alternately) and accumulates
timing data in a file for later evaluation. If some devs would do that
for a few weeks we'd have data. OTOH this sounds very scientific and
complex, and oh, requires ./configure each time :/
Heck, just try it and tell me if it "feels" faster ;)

Best,
Rob

PS: i had this around for a few weeks but talking to fjf and luca on
irc inspired me to fix the outstanding issues -- Thanks guys!

=====

GCC precompiled headers

* GccPchReadme.txt ... this file
* gcc-pch.mk ......... rule for building all.h.pch in each directory
* ac-helpers/abi-gcc-pch.m4 ... configure options
         --enable-gcc-pch=yes/no/auto ("yes" obviously only works for
pch capable gcc like 4.0 and greater)

Approach: one "all.h" file is created and compiled per source directory.
Strategy: include all headers that are mentioned more than once in a directory.
Note: Because all.h is created using grep there must be a possibility
to distinguish between unconditionally and conditionally included
headers (headers between #ifdef statements). The latter must be
indented so they can be excluded.

GCC's dependency generation is used, the precompiled headers do not
depend on system headers though. I figured that for speeding up the
hack-build-test cycle this would not be important and only cost time.

Some headers seem to cause problems, therefore blacklisted them in a
pch-blacklist.sed file in the respective directory. If a directory
contains such a file it is applied on all.h before the creation of
all.h.pch.

Here are the numbers of a respective single run on blueant from a
clean source tree (including autogen.sh, configure). These values
don't mean much though because this machine is serving as a web
server. Also PCHs should mainly benefit rebuilds.

without:
real 4m52.032s
user 3m52.814s
sys 0m37.970s

with:
real 4m44.336s
user 3m53.413s
sys 0m38.119s

Directories excluded because of errors (no PCHs used at all):

* src/af/ev/unix/ problably because C and C++ is mixed
* src/wp/impexp/xp/ no idea why it bails on the msword importer

- Robert Staudinger, 2005-09-09
Received on Fri Sep 9 12:58:41 2005

This archive was generated by hypermail 2.1.8 : Fri Sep 09 2005 - 12:58:41 CEST