On my home machine, I've been experimenting with a program named ccache
(http://ccache.samba.org.)  It's pretty damn nice.  Checkout the summary
I put together:


The following are tests of ccache (http://ccache.samba.org) 
on a 2.5.44 kernel compile.  The CPU is 
Intel(R) Pentium(R) 4 CPU 1.70GHz rated at 3391.48 bogomips.  
All compiles were done with the same .config file.  Steps:
   make mrproper
was executed to clean the tree.  Then modified the Makefile, 
prepending 'ccache' to the CC definition.  Then:
   cp ../config/config-2.5.44 .config
   make oldconfig
   make dep
Finally:
   make clean
   make modules
   make bzImage

Results:
                     bzImage         modules
ccache first run     8:23.75         14:53.48         
ccache second run    1:37.72          2:34.94
ccache disabled*     7:37.36         14:52.95
ccache third run     1:47.84          3:00.99
ccache removed                       14:54.92

* disabled with 'export CCACHE_DISABLE=true'

Cache statistics after the third run.  All misses were generated
in first run.  Hits increased to within about 5 of misses after the
second run.  The disabled run did not affect it at all.  The third
run increased the hits to almost double the misses.
   [todd@trip ~/src/linux-2.5.44/log]$ ccache -s
   cache hit                           2574
   cache miss                          1296
   compile failed                         1
   not a C/C++ file                      21
   no input file                         28
   files in cache                      2592
   cache size                          14.3 Mbytes

Then I modified the Makefile, adding ccache back in.  Then I changed
a few items in the .config and reran:
   make clean
   make oldconfig
   make dep
And then the modules and bzImage targets.  I wasn't really interested
in it being faster.  Instead, I wanted to see it register a high
percentage of hits and a low percentage of misses.  Compare to the
previous cache stats:
   [todd@trip ~/src/linux-2.5.44]$ ccache -s
   cache hit                           3846
   cache miss                          1302
   compile failed                         1
   not a C/C++ file                      28
   no input file                         36
   files in cache                      2604
   cache size                          14.4 Mbytes
Notice how cache hits went way up, cache misses incremented only slightly,
and the cache size increased slightly.  This seems to be desired behavior.

This seems like a nice thing to have, at least on build machines.
Anybody got any horror stories about this?
-- 
Blue skies...           Todd
| Get a bigger hammer!   |  schroom niet--if you consider doing    |
| http://www.mrball.net  |  it, stop cosidering and *do* it.       |
| http://faq.mrball.net  |                         --Wouter Teepe  |
   Linux kernel 2.5.44   2 users,  load average: 0.06, 0.25, 0.28

Attachment: msg80287/pgp00000.pgp
Description: PGP signature

Reply via email to