What strategies have you used to improve build tim

2019-01-21 19:42发布

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?

20条回答
祖国的老花朵
2楼-- · 2019-01-21 20:38

Unity Builds

Incredibuild

Pointer to implementation

forward declarations

compiling "finished" sections of the proejct into dll's

查看更多
放我归山
3楼-- · 2019-01-21 20:40

It's a pet peeve of mine, so even though you already accepted an excellent answer, I'll chime in:

In C++, it's less the language as such, but the language-mandated build model that was great back in the seventies, and the header-heavy libraries.

The only thing that is wrong about Cătălin Pitiș' reply: "buy faster machines" should go first. It is the easyest way with the least impact.

My worst was about 80 minutes on an aging build machine running VC6 on W2K Professional. The same project (with tons of new code) now takes under 6 minutes on a machine with 4 hyperthreaded cores, 8G RAM Win 7 x64 and decent disks. (A similar machine, about 10..20% less processor power, with 4G RAM and Vista x86 takes twice as long)

Strangely, incremental builds are most of the time slower than full rebuuilds now.

查看更多
登录 后发表回答