[ccache] [patch] Massive performance degradation with direct mode due to bypassing filesystem cache with mmap (Mac/PPC)

Christian Lohmaier lohmaier+ccache-ml at googlemail.com
Mon Aug 23 05:35:36 MDT 2010


Hi *,

nice to see ccache back active :-) - but I was shocked when I tried
direct mode on Mac/PPC. For comparison:

real time for compiling OOo's binfilter module in preprocessor mode:
8:30 (8 Minutes, 30 Seconds), with filled cache
real time for compiling OOo's binfilter module in direct mode: 35:50
(no typo thirty-five minutes compared to eight)

While investigating this problem, I found the root cause: Using mmap
to load all the include files bypasses the filesystem cache, and I/O
performance on Mac isn't great to begin with… (On Mac Intel with
RAID0, direct mode performed slightly better than preprocessor mode,
thus you might only experience it on systems with pathetic I/O)

Changing the corresponding code to use read instead solved this
problem. Then direct mode is down to 4:10 - Yay! :-)

But while browsing the code, two other questions came up:
* is there any reason why you don't use calloc but use malloc + memset?
* when using ccache 2.4, the patch to fix --ccache-skip was needed, at
first glance that code did not change, so my guess is that it is still
needed?
http://www.mail-archive.com/ccache@lists.samba.org/msg00197.html
(talking about this one)

Also I noticed that ccache now reject everything remotely looking like
a filelist, this is a little unfortunate since OOo uses -install_name
@_(50 underscores)identifier/libraryname to later rewrite it to the
target location and thus those compiles won't be cached - hashing
install_name and its value should be OK....

ciao
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ccache-read.patch
Type: text/x-patch
Size: 887 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/ccache/attachments/20100823/c01b05af/attachment.bin>


More information about the ccache mailing list