4 ms·
> I think it's hard to draw absolute conclusions because small things can make a huge difference to build times. Of course. I tried my best to optimize the C++
by strager 4y ago
> I think it's hard to draw absolute conclusions because small things can make a huge difference to build times.
Of course. I tried my best to optimize the C++ build and the Rust build.
> It's also very important to be able to see how your build tool is scheduling tasks and making use of your CPUs - often some odd dependencies force most of your cores to sit idle while something gets done.
This is a good point. I didn't spend much time profiling and tweaking this aspect of the Rust build (cargo build --timings).
> The structure of your code matters too - a simple optimisation for C/C++ is just to have much larger source files rather than splitting everything up into many small ones. This acts to reduce the number of repeated includes.
For clean builds, yes, this helps. But for incremental builds, where I need to test a change to just one .cpp file, larger source files are worse.