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: 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
> optimizer.

Right.
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.


> 
> 	Jakub
> 


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