[ccache] Buffer size for IO operations is too small

Anders Björklund anders at itension.se
Sun Apr 3 11:18:05 UTC 2016

Michael Kolomeytsev wrote:
> I've discovered that there is too small buffer size for IO in ccache: 16k
> or 10k
> (in hash_fd, copy_fd, copy_file).
> I did simple fix and run several tests (on mac osx) trying to recompile
> chromium.
> (Of course there was 100% cache hit).
> Results (pay your attention to sys time):

It would probably be interesting to make this configurable,
especially when actually doing compression and checksumming
(and not just copying). We could also do with some updated
and more formalized benchmarks, so that we can all compare ?

But your observations are very interesting, and please post
more if you have it. Would also be nice to have some follow-up
on the observation about ccache problems with multiple cores:
https://github.com/jrosdahl/ccache/issues/54 (also on OS X)

I'm thinking that hash and copy could do with different macros...

Also wondering if we should move from stack to heap allocation ?
Or if we should do smaller buffers for smaller files, perhaps.

Played around with some different md4 and different compressions.


More information about the ccache mailing list