Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: improved build speed by 5x when using ccache #15147

Merged
merged 1 commit into from May 19, 2017

Conversation

Projects
None yet
3 participants
@bassam
Copy link
Member

bassam commented May 18, 2017

when building with ccache we were not taking advantage of "direct mode" (see https://ccache.samba.org/manual.html#_the_direct_mode) due to the unnecessary "-Wp" cflags. I removed that "-Wp" cflags and now see about a 5x (!) improvement in build speed when using ccache.

# with this change (on second clean build)
cmake -DWITH_CCACHE=ON ..
time make -j3 ceph-common
<snip>
real	0m6.833s
user	0m6.900s
sys	0m2.196s

and ccache stats show that we're using direct mode:

cache hit (direct)                   173
cache hit (preprocessed)               0
cache miss                             0
cache hit rate                    100.00 %
called for link                        7
cleanups performed                     0
files in cache                      3786
cache size                         654.3 MB
max cache size                      10.0 GB

and before this change:

# without this change (on second clean build)
cmake -DWITH_CCACHE=ON ..
time make -j3 ceph-common
<snip>
real	0m32.628s
user	1m15.464s
sys	0m10.476s

and ccache stats show (mostly) preprocessed mode:

cache hit (direct)                     2
cache hit (preprocessed)             172
cache miss                             0
cache hit rate                    100.00 %
called for link                        7
cleanups performed                     0
files in cache                      3960
cache size                           1.1 GB
max cache size                      10.0 GB
cmake: remove "-Wp" compile option to speedup ccache
"-Wp" in not needed and when building with ccache the "cache hits"
only happen afer preproccessing which is slower than a direct hit.
this change removes the "-Wp" option

Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>

@tchaikov tchaikov added the build/ops label May 18, 2017

@tchaikov tchaikov added the needs-qa label May 18, 2017

@tchaikov

This comment has been minimized.

Copy link
Contributor

tchaikov commented May 18, 2017

pushed to ceph-ci with the name wip-15147-kefu

@yuriw yuriw merged commit 4d1d9ca into ceph:master May 19, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.