View previous topic :: View next topic |
Author |
Message |
ImErina n00b
Joined: 10 Feb 2022 Posts: 51
|
Posted: Fri Jun 16, 2023 9:15 am Post subject: Can ccache reduce llvm compiling? |
|
|
When installing llvm, clang, compiler-rt, libclc and so, a lot of things are compiled several times. With in ccache.conf, can it reduce the times of compilation between these packages? |
|
Back to top |
|
|
ImErina n00b
Joined: 10 Feb 2022 Posts: 51
|
Posted: Sat Jun 17, 2023 12:36 am Post subject: |
|
|
A quick test shows that is it possibly cannot.
Here's what ccache says after building llvm, clang, libclc.
Code: |
Cacheable calls: 5855 / 6446 (90.83%)
Hits: 212 / 5855 ( 3.62%)
Direct: 79 / 212 (37.26%)
Preprocessed: 133 / 212 (62.74%)
Misses: 5643 / 5855 (96.38%)
Uncacheable calls: 591 / 6446 ( 9.17%)
Local storage:
Cache size (GB): 0.3 / 25.0 ( 1.22%)
Hits: 212 / 5855 ( 3.62%)
Misses: 5643 / 5855 (96.38%)
|
So how exactly does ccache works? What does it take into account for generating a hash? |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22602
|
Posted: Sat Jun 17, 2023 12:54 am Post subject: |
|
|
According to How ccache works (ccache manual): Code: | The detection is done by hashing different kinds of information that should be unique for the compilation and then using the hash sum to identify the cached output.
...
The following information is always included in the hash:
the extension used by the compiler for a file with preprocessor output (normally .i for C code and .ii for C++ code)
the compiler’s size and modification time (or other compiler-specific information specified by compiler_check)
the name of the compiler
...
In the preprocessor mode, the hash is formed of the common information and:
the preprocessor output from running the compiler with -E
... | I omitted the parts unlikely to be relevant to your question, but you can see them at the linked document. |
|
Back to top |
|
|
Ginta Apprentice
Joined: 17 Feb 2006 Posts: 152 Location: Spain
|
Posted: Sat Jun 17, 2023 1:08 pm Post subject: |
|
|
Ccache is proven to be useful only on rebuilds (ebuild testing, emerge -e world, manual reinstall, etc) but not on new installs.
Also, some USE changes alter internal constants so it renders the cache invalid again.
So unless you do a lot of same or nearly same scenario recompiles ccache is not helping. _________________ Some people should use emerge brain on theirselves... |
|
Back to top |
|
|
|