您使用什么策略来缩短大型项目的构建时间?

我曾经参与过一个 C++ 项目,该项目花了大约一个半小时才能完全重建.小的编辑、构建、测试周期大约需要 5 到 10 分钟.这是一场徒劳的噩梦.

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?

更新:

您认为所使用的语言在多大程度上是造成问题的原因?我认为 C++ 容易对大型项目产生大量依赖,这通常意味着即使是对源代码的简单更改也会导致大量重建.您认为哪种语言最能应对大型项目依赖问题?

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?

推荐答案

  1. 前向声明
  2. pimpl 成语
  3. 预编译头
  4. 并行编译(例如 Visual Studio 的 MPCL 插件).
  5. 分布式编译(例如 Visual Studio 的 Incredibuild).
  6. 增量构建
  7. 在多个项目"中拆分构建,因此如果不需要,不要编译所有代码.

[后期编辑]8. 购买速度更快的机器.

[Later Edit] 8. Buy faster machines.

相关文章