4 ms·
I use c++ on the daily and find that ccache and an m1/2/3 cpu go a very long way to reducing build times.
by LeSaucy 2y ago
I use c++ on the daily and find that ccache and an m1/2/3 cpu go a very long way to reducing build times.
- MathMonkeyMan 2y agoNot sure why this was downvoted. It's true that ccache and build parallelization (e.g. icecream) can grease the wheels enough that builds are no longer a dev cycle bottleneck. What the article is about, though, is changing the source code so that it is intrinsically faster to compile. At some point you say "this program isn't complicated, why does it take so long to compile?" Then you start looking at unnecessary includes, transitive includes, forward declarations, excessive inlining, etc.
- rjkaplan 2y agoI'm guessing the comment was downvoted because the suggestions are mentioned in the first paragraph of the article... > After trying a few stopgap solutions—like purchasing M1 Maxs for our team—build times gradually reverted to their original pace; Ccache and remote caching weren’t enough either.
- gpderetta 2y agoParallelization is not a stop gap solution. Is the only scalable one as C++ projects tend to grow to multimilion lines of code easily. And with distcc (or similar) you do not need to buy your developers beefy workstations (although you should!).
- scheme271 2y agoYeah, I got 15 minute build times down to under 30s using ccache. Doesn't help with cold rebuilds but once you have a cache, it really does help things significantly.
- ErikCorry 2y agoCcache is great but then change one central .h file and you are back to square one.
- gpderetta 2y agoCcache + distcc (or similar caching/distributed build solutions) work very well.