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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ccache in Travis builds (up to 4x faster) #575

Merged
merged 1 commit into from Sep 21, 2018

Conversation

Projects
None yet
2 participants
@lslezak
Member

lslezak commented Sep 21, 2018

Faster Rebuilds at Travis

  • Use ccache to make the rebuilds faster
    • The ~/.ccache directory is cached by Travis, see the Travis documentation about caching
    • Downloading the cache at Travis is quite fast, in this case it's ~15 seconds
    • If the source is found in the cache the cached result is returned immediately without need for recompiling
  • Improved Git unshallowing - check if the repository is actually a shallow clone, this avoids a failure when running locally with a full clone
  • Use a specific Docker image for building, reusing big YaST image and adapting it to libstorage-ng takes some extra time, this saves ~40 seconds for each build

Speed Up

  • The usual time to build the libstorage-ng in Travis was almost half an hour (~29minutes, see the history)
  • With the ccache the rebuild takes ~6:30 (an example log), that's about 4x times faster in the ideal case when there is no code change at all.

Disclaimer 馃槈

Obviously the speedup depends how much the code or the environment has been changed since the last build. If there is a just small change the cache will help a lot, if there is a major change, for example updated some base class which is often used the speed up will be smaller. If some dependent library (boost) or the compiler itself is updated then the cache might not help at all and the build will take again full time (i.e. up to 1/2 hour).

But the next rebuild should again take the advantage of the cached files and should be faster again.

Let's see how much it helps in reality...

@ancorgs

LGTM

@lslezak lslezak merged commit be83b56 into openSUSE:master Sep 21, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@lslezak lslezak deleted the lslezak:ccache branch Sep 21, 2018

@lslezak lslezak referenced this pull request Sep 21, 2018

Closed

Squad Sprint 63 Post Draft #164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment