4 ms·
> Put all your #includes in one include.h file RIP incremental build times. > Then make a precompiled header for include.h (gcc, clang, and even msvc can do t
by MaulingMonkey 10y ago
> Put all your #includes in one include.h file
RIP incremental build times.
> Then make a precompiled header for include.h (gcc, clang, and even msvc can do this), which will vastly speed up compile times, and compensate for the overhead of including unnecessary headers in your code that doesn't need to include everything.
Speaking from experience, god no it doesn't. Those are the codebases where fixing a single typo may take an hour to fully rebuild a single build configuration. As the poor bastard charged with porting things and managing said build configurations, this means I either break the build from time to time, or have to wait overnight to have a full set of builds to test before checking anything in.
- signa11 10y ago> ...vastly speed up compile times, ... Just use ccache if build times are getting atrocious, then focus on getting link times down :)
- MaulingMonkey 10y agoccache won't help much if every TU changes with every typo fix - nothing but cache misses. But yes, use ccache or similar to accomplish proper incremental builds. As for link times: switch from bfd to gold. And maybe play with --incremental. I didn't - just switching to gold shaved minutes off my link times for free, and suddenly link times were no longer my build bottleneck :)