What strategies have you used to improve build times on large projects?
build-automation, build-process, c++, compiler-construction
Solution
- Forward declaration
- pimpl idiom
- Precompiled headers
- Parallel compilation (e.g. MPCL add-in for Visual Studio).
- Distributed compilation (e.g. Incredibuild for Visual Studio).
- Incremental build
- Split build in several "projects" so not compile all the code if not needed.
[Later Edit] 8. Buy faster machines.
Problem
I once worked on a C++ project that took about an hour and a half for a full rebuild. Small edit, build, test cycles took about 5 to 10 minutes. It was an unproductive nightmare. What is the worst build times you ever had to handle? What strategies have you used to improve build times on large projects? Update: How much do you think the language used is to blame for the problem? I think C++ is prone to massive dependencies on large projects, which often means even simple changes to the source code can result in a massive rebuild. Which language do you think copes with large project dependency issues best?