Re: [ccache] Radically different ccache performance on Linux vs OSX

2010-09-14 Thread Martin Pool
As a poorly-informed guess, maybe the OS X build is turning on
pre-compiled headers in a way ccache 2.4 can't cope well with?

-- 
Martin
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Radically different ccache performance on Linux vs OSX

2010-09-14 Thread Joel Rosdahl
On 2010-09-14 21:43, Christopher Tate wrote:
> [...]
> Right now I'm doing some tests around using the new
> CCACHE_SLOPPINESS=file_macro tweak, and initial results are
> promising... but that begs the question of why the results on OSX with
> 2.4 are so poor in general.
> 
> The obvious guess is that there's *something* about our cross-build
> chain and environment that differs from the Linux-hosted versions just
> enough to be upsetting ccache.  Any tips on what I should go looking
> for?

My guess is that some include file in the OSX toolchain contains a
__FILE__ or __TIME__ macro that gets expanded (and kept). This would
explain the cache misses for both ccache 2.4 and 3.0. You should be able
to find the difference by comparing the preprocessor output of two
identical compilation commands. That is, given that you compile with
something like

gcc ...options... -c file.c -o file.o

you could do this:

gcc ...options... -E file.c -o file1.i
gcc ...options... -E file.c -o file2.i
diff file1.i file2.i

If the culprit is a __FILE__ or __TIME__, you could consider patching
the toolchain, or you could set CCACHE_SLOPPINESS as you mention. (But
setting CCACHE_SLOPPINESS only affects direct mode, so preprocessor mode
will still miss.)

-- Joel
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


[ccache] Radically different ccache performance on Linux vs OSX

2010-09-14 Thread Christopher Tate
We have a large cross-compilation environment that is essentially
identical on both Linux and MacOS X hosts.  The build system uses
ccache to try to reduce redundant recompilation, but we're seeing
radically different outcomes on OSX versus Linux hosts.  We're still
using ccache 2.4.

On Linux hosts, the aggregate performance seems to be roughly a 3:1
cache hit-to-miss ratio.  However, on OSX, ccache seems to be
providing almost no benefit:  we see something like a 1:15 cache
hit-to-miss ratio -- at which point we might as well not be using
ccache at all.

I've been looking into this a bit with 3.0 (actually tip of tree) on
OSX.  Using ccache 3 [in its default mode of direct mode then fallback
to preprocessor], 90%+ of the misses that I see in the log are failure
to find the manifest file at all, and I'm seeing a similar very low
hit rate overall.  Right now I'm doing some tests around using the new
CCACHE_SLOPPINESS=file_macro tweak, and initial results are
promising... but that begs the question of why the results on OSX with
2.4 are so poor in general.

The obvious guess is that there's *something* about our cross-build
chain and environment that differs from the Linux-hosted versions just
enough to be upsetting ccache.  Any tips on what I should go looking
for?

Thanks!

--
chris tate
android framework engineer
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] ccache and Sun Studio

2010-09-14 Thread Mehturt
On Tue, Sep 14, 2010 at 5:20 PM, Joel Rosdahl  wrote:
> I didn't know about this specific clash, but there are others very
> similar described in this bug report:
>
> https://bugzilla.samba.org/show_bug.cgi?id=7556
>
> You can create a new bug report if you want, or just leave a comment in
> 7556.

Thanks a lot, I added a comment to that bug.
m.
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] ccache and Sun Studio

2010-09-14 Thread Joel Rosdahl
On 2010-09-14 12:23, Mehturt wrote:
> I tried to use ccache 3.0.1 with Sun's Studio 12 compiler.
> It seems to work just fine, except for some -x parameters that the
> compiler has, such as -xarch, -xtarget etc..
> The ccache thinks of the -x parameter as the language setting, which
> works only for gcc.

A possible workaround is to add --ccache-skip before each troublesome
parameter. Or rather: It should have been possible, but it's buggy in
3.0.1. It will be fixed in 3.1.

> So is ccache supposed to work with Sun's Studio 12?  Should I create a
> bug report for this?

I didn't know about this specific clash, but there are others very
similar described in this bug report:

https://bugzilla.samba.org/show_bug.cgi?id=7556

You can create a new bug report if you want, or just leave a comment in
7556.

As noted in a comment to the bug report, I think that a good way to
handle this is to make ccache perform compiler detection (and cache the
results of it) so that it knows to (in this case) leave -xarch and
friends alone. I guess it's also feasible to introduce a ccache setting
that let's you select which kind of compiler you have, but it would be
nicer to handle it transparently.

-- Joel
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


[ccache] ccache and Sun Studio

2010-09-14 Thread Mehturt
Hi,
I tried to use ccache 3.0.1 with Sun's Studio 12 compiler.
It seems to work just fine, except for some -x parameters that the
compiler has, such as -xarch, -xtarget etc..
The ccache thinks of the -x parameter as the language setting, which
works only for gcc.
So is ccache supposed to work with Sun's Studio 12?  Should I create a
bug report for this?
Thanks..
m.
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache