gpt4 book ai didi

c++ - ccache 缓存未命中会减慢编译速度

转载 作者:技术小花猫 更新时间:2023-10-29 11:24:11 24 4
gpt4 key购买 nike

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

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,如果它改变了什么的话。

最佳答案

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

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

关于c++ - ccache 缓存未命中会减慢编译速度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38056780/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com