This is the mail archive of the
mailing list for the GCC project.
Re: Using ccache to improve compilation speed
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Craig Rodrigues <rodrigc at attbi dot com>, <gcc at gcc dot gnu dot org>
- Date: Tue, 7 May 2002 07:47:23 -0400 (EDT)
- Subject: Re: Using ccache to improve compilation speed
On Tue, 7 May 2002, Jakub Jelinek wrote:
> On Mon, May 06, 2002 at 08:38:03PM -0400, Craig Rodrigues wrote:
> > Hi,
> > Has anybody looked at ccache, written by Andrew Tridgell of the
> > Samba project? ( http://ccache.samba.org/ )
> > ccache claims to improve compile-time performance of C/C++
> > code by caching preprocessor output.
> > Could this type of functionality be integrated somehow in
> > gcc?
> I thought about this too.
> The problem of tridge's ccache with integrated preprocessor is that
> it kills the advantages of integrated preprocessor, ie. it does effectively
> what -save-temps does know, preprocesses into file, then does its own magic
> (checksums it) and then conditionally compiles that.
> If ccache was integrated, the checksumming (and canonicalizing of .i/.ii
> output) could be done as filter between cpplib and the compiler,
> unfortunately if the compilation should be conditional, then it would need
> to preprocess everything first (while checksumming it), then in another pass
> throw the preprocessed tokens into parser and further into
The reason ccache improves compilation speed is because of false
dependencies in makefiles and whatnot.
If a file hasn't changed in a way that affects its preprocessor output,
why the heck are we recompiling it in the first place?
It's cases where a file hasn't changed, but we recompile it anyway, the
Tridge's ccache speeds up.
None of these cases are things a compiler itself should care about.
Not that these cases don't occur, and don't occur often (obviously, they
do), but it's not for gcc to be handling. It's much better handled by
something like ccache.