Closed claremacrae closed 3 years ago
This shows that even on Linux, where Boost needs to be downloaded - which takes around 20-25 seconds, the bulk of the elapsed time is on the compile and link stage - suggesting that it's worth trying ccache.
Travis: 40 - 45 minutes elapsed time
I misread that - it's saying:
So we aren't having to wait for 43 mins - but even so, it would be nice to have feedback sooner - before we have moved on to other things...
Following the Travis instructions for enabling ccache (https://docs.travis-ci.com/user/caching/#ccache-cache):
Effect on Build Timings
Step | Total build time | Build log |
---|---|---|
Before enabling ccache | 43 min 33 sec | #83 |
First build after enabling ccache | 60 min 55 sec | #84 |
Second build after enabling ccache (no code changes) | 39 min 33 sec | #85 |
Consequences of ccache - first implementation:
OS | Compiler | Effect |
---|---|---|
Ubuntu | gcc | Better! ccache adds about 10 seconds to build time - but then takes at least 2 minutes off a repeat build - so really well worth it. |
Ubuntu | clang | Worse! ccache adds a few seconds to build time - and then build time is even worse on repeat build - adding about 30 seconds per build |
macOS | Xcode | Massively worse! ccache increases build macOS times from 3-4 minutes to 5-10 minutes for the initial build - and then 2 mins 20 to 8 mins 40 for repeat build |
Useful links to improve the macOS builds - and maybe clang too:
Tool to validate Travis config: https://config.travis-ci.com/explore
By https://github.com/claremacrae/ApprovalTests.cpp/commit/0b826b252ab00fa4eb923ba737465c6d85f13e34 I have got the total build time down to 22 min 31 sec!
Most repeat builds take between
The outlier is Xcode 8.1.0 on a max)S 10.12 (Sierra) image, which taks 4 min 10 secs'.
Since Apple dropped support for that OS in October 2019, I don't plan to spend any time on improving build times on that configuration, so I'll remove it from the Travis build matrix instead.
Current status of Travis builds on the travis_ccache
branch of my fork:
Step | Elapsed built time | Total build time | Build log |
---|---|---|---|
Before enabling ccache | 12 min 12 sec | 43 min 33 sec | #83 |
First build after enabling ccache | 16 min 16 sec | 60 min 55 sec | #84 |
Second build after enabling ccache (no code changes) |
11 min 09 sec | 39 min 33 sec | #85 |
Second build after using Craig Scott mechanism to properly enable ccache in Makefiles, Ninja and XCode |
12 min 05 sec | 42 min 49 sec | #89 |
Second build after also stopping home-brew from updating all packages |
7 min 06 sec | 22 min 31 sec | #90 |
Second build after dropping support for Xcode 8.3 (macOS 11.12 Sierra) |
6 min 08 sec | 17 min 01 sec | #91 |
Repeat of the above (so some variability) |
6 min 16 sec | 18 min 37 sec | #93 |
I think the only potential big gain now would be to cache the Boost download between Linux builds - which I would have to do manually, so which would complicate the script somewhat.
There are some hints on how to do that in this change: https://github.com/loot/loot/commit/863939c2c51b6f5a14f264cf71b7809f58b34c8a
Commits for this are on a branch on my fork: https://github.com/claremacrae/ApprovalTests.cpp/commits/travis_ccache
There are some useful links in this: https://github.com/marketplace/actions/conan-cache
Possibly also useful: https://raymii.org/s/articles/Github_Actions_cpp_boost_cmake_speedup.html
We deleted Travis builds in e54031bef345a6fb2d696e5a0fff9020d826a699 - and can live with the AppVeyor times for now, so I'm closing this issue.
Feedback is painfully slow from our Travis and AppVeyor CI builds now: