News for hackers. Stuff that matters.
Re:Speeding up C++ build times by LeSaucy on Sunday April 28, 2024 @05:19PM (#40192061)
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.
Re:Speeding up C++ build times by MathMonkeyMan on Sunday April 28, 2024 @05:57PM (#40192360)
Not 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.

Re:Speeding up C++ build times by rjkaplan on Sunday April 28, 2024 @10:43PM (#40193862)
I'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.

Re:Speeding up C++ build times by gpderetta on Monday April 29, 2024 @07:31AM (#40197016)
Parallelization 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!).
Re:Speeding up C++ build times by scheme271 on Sunday April 28, 2024 @10:42PM (#40193859)
Yeah, 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.
Re:Speeding up C++ build times by ErikCorry on Monday April 29, 2024 @03:32AM (#40195536)
Ccache is great but then change one central .h file and you are back to square one.
Re:Speeding up C++ build times by gpderetta on Monday April 29, 2024 @07:29AM (#40197000)
Ccache + distcc (or similar caching/distributed build solutions) work very well.