Only save CircleCI source cache once a day #19958
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We use CircleCI caching to speed up the source checkout step in our test runs by saving the entire
.git
directory. This is almost 7GB, but caching it speeds up the checkout step from 6 minutes to 1 minute. However, the cache itself takes 1 minutes to restore, and 4 minutes to save, completely eliminating the gains in the checkout step.We can get the best of both worlds by saving a new version of the cached
.git
directory only once a day. The checkout step just has to download a day's worth of new changes, which should be quick, and the 4 minute save step only hits the first build each day instead of every single build.