Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Mar 2006 14:26:36 +0100
From:      Alex Dupre <ale@FreeBSD.org>
To:        freebsd-current@FreeBSD.org,  freebsd-ports@freebsd.org, ahze@FreeBSD.org
Subject:   Using ccache with make world
Message-ID:  <441FFF0C.4010107@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Short summary:

I made a patch to ccache port so that we can actually and effectively
use ccache when making buildworld and buildkernel. The patch can be
found at: http://www.alexdupre.com/ccache.diff
Read the ccache-freebsd-howto.txt file before using ccache.

Long description:

As you know, until now, building FreeBSD with ccache spotted several
issues because of the complex "make world" process; in particular it
changes the default path and build a new compiler with different header
files and this avoids any effective use of ccache. Some workarounds grew
up, but they fix only a subset of the problems, creating (sooner or
later) issues elsewhere. This patch tries to fix (or at least minimize)
all the problems, implementing a mixture of floating ideas collected
from various threads. For an implementation overview, I recommend to
read the simple patch, because explaining it will be more complex for me :-)

Benchmarks:

Just booted into a new world/kernel, compiled (and installed) for the
first time with ccache. /usr/obj is empty.

# ccache -s
cache directory                     /usr/.ccache
cache hit                            932
cache miss                         16144
called for link                      755
multiple source files                  1
compile failed                       107
preprocessor error                    35
not a C/C++ file                    1550
autoconf compile/link                807
unsupported compiler option          546
no input file                        116
files in cache                     32288
cache size                         219.7 Mbytes
max cache size                     976.6 Mbytes

# time make buildworld
[...]
547.504u 206.484s 18:02.28 69.6%       2792+1865k 38436+7220io 6874pf+0w

# ccache -s
cache directory                     /usr/.ccache
cache hit                          13027
cache miss                         16265
called for link                     1311
multiple source files                  2
compile failed                       107
preprocessor error                    35
not a C/C++ file                    2759
autoconf compile/link                807
unsupported compiler option          546
no input file                        117
files in cache                     32530
cache size                         220.0 Mbytes
max cache size                     976.6 Mbytes

# time make buildkernel
[...]
125.756u 47.537s 5:03.57 57.0%  2664+1990k 13871+4882io 715pf+0w

# ccache -s
cache directory                     /usr/.ccache
cache hit                          15070
cache miss                         16268
called for link                     1314
multiple source files                  2
compile failed                       107
preprocessor error                    35
not a C/C++ file                    2763
autoconf compile/link                807
unsupported compiler option          552
no input file                        117
files in cache                     32536
cache size                         220.2 Mbytes
max cache size                     976.6 Mbytes

--
Alex Dupre



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?441FFF0C.4010107>