c++buildbuild-automation

What strategies have you used to improve build times on large projects?


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?


Solution

    1. Forward declaration
    2. pimpl idiom
    3. Precompiled headers
    4. Parallel compilation (e.g. MPCL add-in for Visual Studio).
    5. Distributed compilation (e.g. Incredibuild for Visual Studio).
    6. Incremental build
    7. Split build in several "projects" so not compile all the code if not needed.

    [Later Edit] 8. Buy faster machines.