This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: query reg. gcc
- From: Dale Johannesen <dalej at apple dot com>
- To: sdeepak at cadence dot com
- Cc: Dale Johannesen <dalej at apple dot com>, Paul Koning <pkoning at equallogic dot com>, gcc <gcc at gnu dot org>
- Date: Wed, 22 Dec 2004 20:39:04 -0800
- Subject: Re: query reg. gcc
- References: <41C98AD5.6050503@cadence.com> <16841.36633.159000.289673@gargle.gargle.HOWL> <41CA44FE.6080902@cadence.com>
On Dec 22, 2004, at 8:09 PM, Deepak Soi wrote:
Paul,
First of all, thanks for the fast reply. What I feel is
,I can't use precompiled headers in my project. As i have a number of
modules in our whole project, and each module has different header
requirements. However with in a module , the headers required by all
.cpp files are almost same.So in case I set aside few headers to be
pre-compiled for whole project, it won't work. Also, second thing is i
don't know about the which header files will be reqd. by each module
in advance , without scanning the whole project, so i can't choose
which headers to precompile.
Whereas if we can cache the header-file which is
once loaded in to memory, then later if its reqd, we won't load it
again, during the compilation of next .cpp file, it can be of help- in
saving the compilation time of the next .cpp file. What you suggest?
Can it be an additional functionality? Do we have something to support
it right now in gcc ?
You don't say what OS you're on, but in most cases, a new subprocess is
invoked for each file that's compiled, and it retains no in-memory data
from
the previous file. So there's no way to do what you're asking.
Precompiled
headers put the data to be retained on disk, and that's the best you
can do.
(Incidentally, the multiple subprocesses are partly responsible for the
slowdown
you're seeing, although it's probably a minor effect compared to the
header
files. You might try -combine, which gets rid of the multiple
subprocesses but
not the rereading of header files. Be prepared for it to run out of
memory on
a big project, though.)
It is probably worth the effort to figure out subset(s) of your header
files that can
profitably be made into precompiled headers. It sounds like one pch for
each of your modules would work well.