12

刚刚开始使用基于本教程的 ccache ,到目前为止我喜欢它。但是,缓存未命中非常慢。这是我的结果:

Regular clean build without ccache : 1m40s
First build with ccache : 4m36s
Second build with ccache : 30s

我不确定从哪里开始调试。性能页面 ( https://ccache.samba.org/performance.html ) 提到了 make 文件的复杂性如何减慢编译速度,但在这种情况下,我使用 Xcode,所以调用 ccache 应该相对较快。我期待一些性能下降,但不是这么多!

我当前的设置使用 3.2.5 版本:

export CCACHE_MAXSIZE=3G
export CCACHE_HARDLINK=true
export CCACHE_SLOPPINESS=pch_defines,file_macro,time_macros,include_file_mtime,include_file_ctime,file_stat_matches

请注意,我确实使用了 pch,如果这改变了一些东西的话。

4

1 回答 1

5

您可以运行命令“ccache -s”来查看统计信息。

从这个 ccache 错误线程https://github.com/ccache/ccache/issues/54末尾的实验中,尝试减少使用的并行内核编译器可能会有所帮助,来自多个进程的文件锁定可能是根本原因。

于 2016-06-30T02:00:25.267 回答