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

disable ccache in a friendly way #7730

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

lanefu
Copy link
Member

@lanefu lanefu commented Jan 21, 2025

should make this the default.. enables in case PRIVATE_CCACHE=yes is set

reasoning per @rpardini:

  • ccache has 0 cache hit ratio during any kernel version change (version.h)
  • but causes every build to be slower to gather/compare cache
  • armbian/build already tries hard to keep your (worktree) cache make-hot during rebuilds/repatching/reconfigs

@lanefu lanefu requested a review from a team as a code owner January 21, 2025 00:16
@github-actions github-actions bot added size/small PR with less then 50 lines Needs review Seeking for review Framework Framework components labels Jan 21, 2025
Copy link
Member

@rpardini rpardini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR is superior

@lanefu lanefu closed this Jan 21, 2025
@lanefu lanefu reopened this Jan 21, 2025
@rpardini
Copy link
Member

image
image

@lanefu lanefu marked this pull request as draft January 21, 2025 00:50
@lanefu lanefu marked this pull request as ready for review January 21, 2025 01:17
@adeepn
Copy link
Member

adeepn commented Jan 21, 2025

  • ccache has 0 cache hit ratio during any kernel version change (version.h)

how many .c files do you think include version.h?

@igorpecovnik igorpecovnik added the Documentation Documentation changes or additions label Jan 21, 2025
@igorpecovnik
Copy link
Member

Please add bits to the docs, here:

https://docs.armbian.com/Developer-Guide_Build-Switches/#advanced

@igorpecovnik igorpecovnik added Needs Documentation New feature needs documentation entry and removed Documentation Documentation changes or additions labels Jan 21, 2025
@adeepn
Copy link
Member

adeepn commented Jan 21, 2025

linux kernel 6.13.0-rc7 for linux-meson64 on my notebook (time may float due to the use of a laptop during testing, but the trend is clearly visible)

before:

  Cache size (GiB): 0.0 / 5.0 ( 0.00%)
  Cleanups:          61

first build without ccache

real	16m20,265s
user	226m45,734s
sys	28m8,309s

first build with ccache:

export PATH=/usr/lib/ccache:$PATH
export ARCH=arm64
export CROSS_COMPILE=aarch64-none-linux-gnu-
export REAL_CC=aarch64-none-linux-gnu-gcc
make -j16
real	19m40,902s
user	273m16,985s
sys	35m37,396s
$ ccache -s
Cacheable calls:    19117 / 19336 (98.87%)
  Hits:              3502 / 19117 (18.32%)
    Direct:          3502 /  3502 (100.0%)
    Preprocessed:       0 /  3502 ( 0.00%)
  Misses:           15615 / 19117 (81.68%)
Uncacheable calls:    219 / 19336 ( 1.13%)
Local storage:
  Cache size (GiB):   0.5 /   5.0 (10.80%)
  Hits:              3502 / 19117 (18.32%)
  Misses:           15615 / 19117 (81.68%)

repeatable build with ccache:

real	0m38,227s
user	2m52,498s
sys	3m38,345s

real	0m38,355s
user	3m5,663s
sys	4m3,897s

after version change in Makefile build with ccache:

$ ccache -s
Cacheable calls:    62798 / 63685 (98.61%)
  Hits:             47057 / 62798 (74.93%)
    Direct:         34870 / 47057 (74.10%)
    Preprocessed:   12187 / 47057 (25.90%)
  Misses:           15741 / 62798 (25.07%)
Uncacheable calls:    887 / 63685 ( 1.39%)
Local storage:
  Cache size (GiB):   0.5 /   5.0 (10.84%)
  Hits:             47057 / 62798 (74.93%)
  Misses:           15741 / 62798 (25.07%)

real	7m26,959s
user	97m44,005s
sys	17m41,464s

reset ccache stats:

$ ccache -s
Cacheable calls:    15633 / 15833 (98.74%)
  Hits:             15632 / 15633 (99.99%)
    Direct:         15632 / 15632 (100.0%)
    Preprocessed:       0 / 15632 ( 0.00%)
  Misses:               1 / 15633 ( 0.01%)
Uncacheable calls:    200 / 15833 ( 1.26%)
Local storage:
  Cache size (GiB):   0.5 /   5.0 (10.84%)
  Hits:             15632 / 15633 (99.99%)
  Misses:               1 / 15633 ( 0.01%)

repeatable rebuild with ccache without version change:

real	0m42,210s
user	3m15,798s
sys	4m26,176s

@lanefu
Copy link
Member Author

lanefu commented Jan 22, 2025

@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 02 Milestone: First quarter release and removed Needs Documentation New feature needs documentation entry labels Jan 23, 2025
@adeepn adeepn merged commit de97c74 into armbian:main Jan 23, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
02 Milestone: First quarter release Framework Framework components Needs review Seeking for review Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines
Development

Successfully merging this pull request may close these issues.

4 participants