统一构建的好处/坏处?

The benefits / disadvantages of unity builds?(统一构建的好处/坏处?)

本文介绍了统一构建的好处/坏处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从在一家新公司开始工作以来,我注意到他们在我们的大部分解决方案中使用了 unity cpp 文件,我想知道是否有人能够给我一个明确的理由来说明为什么以及如何加速构建过程?我原以为在 unity 文件中编辑一个 cpp 文件会强制重新编译所有文件.

Since starting at a new company I've noticed that they use unity cpp files for the majority of our solution, and I was wondering if anyone is able to give me a definitive reason as to why and how these speed up the build process? I would've thought that editing one cpp file in the unity files will force recompilation of all of them.

推荐答案

非常相似的问题和很好的答案在这里:#include 所有 .cpp 文件到一个编译单元?

Very similar question and good answers here: #include all .cpp files into a single compilation unit?

总结起来似乎是减少 I/O 开销是主要的好处.

The summary seems to be that less I/O overhead is the major benefit.

另请参阅Unity Builds 的魔力,链接在上面的问题也是如此.

See also The Magic Of Unity Builds as linked in the above question as well.

这篇关于统一构建的好处/坏处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:统一构建的好处/坏处?

基础教程推荐