[ccache] Ccache not working for me!

nadim nadim at khemir.net
Fri Oct 29 21:52:12 GMT 2004


Hi, I'm rather surprised to get longer compilation time with ccache than 
without. I must be doing something wrong :-)

I am using my own build system and except it being written by me, it's a plain 
build system. It finds the nodes to build and builds them.

I got irritated earlier this afternoon when I started using it to distribute 
builds. On my box a build took 55s and on my box plus another one it took 
95s! I compiled a node which took 0.8s on my box and 2.1s through my build 
system when it ran remotely. I am sharing the filesystem with NFS and when 
logged onto the remote machine and ran the compilation without any build 
system involved, it took 2.1s. hmm, this is bad news but with all the traffic 
I am just half surprized. There are multiple strategies that I can explore:
- use --pipe with gcc to reduce some of the traffic
- use pre-compiled headers
- write a file synchronizing module for my build system
- use one of the know cached
- your ideas welcome here...

I installed ccache and did some tries on a test system (39 object files). Here 
are the results:

pbs (the build system) alone:
4.80s

pbs+ccache run 1:
7.95s

pbs+ccache run 2 and subsequent runs:
6.85s

here is a typical node:

Tree for ./nailara/os/debug/debug.o:
`- ./nailara/os/debug/debug.c [H1]
   |- /devel/arm-elf-tools/arm-rtos/include/stdio.h [H2]
   |- /devel/arm-elf-tools/lib/gcc-lib/arm-rtos/3.3.1/include/stdarg.h [H3]
   |- /devel/nailara/hal/cpu.h [H4]
   |- /devel/nailara/os/debug/debug.h [H5]
   |- /devel/nailara/os/rtos/bankedregisters.h [H6]
   `- /devel/nailara/os/rtos/rtos.h [H7]

#------------------------------------------------------------------------------
Node './nailara/os/debug/debug.o':
arm-elf-gcc  -O2  -mapcs-32 -mlittle-endian -mshort-load-bytes -mcpu=arm7tdmi 
-ffreestanding -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align 
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline  
-DARCH_OLYMPUS2=1 -DARGUS2=1 -DCPU_ARGUS2=1 -DEXCEPTION_BASE=0x06000000 
-DKERNEL=1 -DKHEAP_32BIT_POOL=1 -DKHEAP_SIZE=0x20000 -DPROC_MAX_PROCESSES=16 
-DPROC_QUANTUM=1000000 -DROBASE=0x06000000 -DROBASE_PHYS=0x06000000 
-DRWBASE=0x06100000 -DRWBASE_PHYS=0x06100000 -DRWLIMIT=0x08000000 
-I /devel/nailara -I/devel/nailara/projects/argus2_test/nailara/os/debug 
-I/devel/nailara/os/debug  
-o /devel/nailara/projects/argus2_test/out_nadim/nailara/os/debug/debug.o 
-c /devel/nailara/os/debug/debug.c
Build time: 0.09 s.

#------------------------------------------------------------------------------
Node './nailara/os/debug/debug.o':
ccache arm-elf-gcc  -O2  -mapcs-32 -mlittle-endian -mshort-load-bytes 
-mcpu=arm7tdmi -ffreestanding -Wall -Wshadow -Wpointer-arith -Wcast-qual 
-Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline  
-DARCH_OLYMPUS2=1 -DARGUS2=1 -DCPU_ARGUS2=1 -DEXCEPTION_BASE=0x06000000 
-DKERNEL=1 -DKHEAP_32BIT_POOL=1 -DKHEAP_SIZE=0x20000 -DPROC_MAX_PROCESSES=16 
-DPROC_QUANTUM=1000000 -DROBASE=0x06000000 -DROBASE_PHYS=0x06000000 
-DRWBASE=0x06100000 -DRWBASE_PHYS=0x06100000 -DRWLIMIT=0x08000000 
-I /devel/nailara -I/devel/nailara/projects/argus2_test/nailara/os/debug 
-I/devel/nailara/os/debug  
-o /devel/nailara/projects/argus2_test/out_nadim/nailara/os/debug/debug.o 
-c /devel/nailara/os/debug/debug.c
Build time: 0.17 s.

That's half the speed!

[nadim at khemir argus2_test]$ ccache -s
cache directory                     /home/nadim/.ccache
cache hit                             24
cache miss                             3
compiler produced stdout             243
unsupported compiler option           81
no input file                         28
files in cache                         6
cache size                            12 Kbytes
max cache size                     976.6 Mbytes

Any idea of what I am doing wrong?

Cheers, Nadim.

PS: any mailing list specialized in build systems you know of?


More information about the ccache mailing list