如何在大型C ++项目中检测编译时的瓶颈? [英] How should I detect bottleneck of compile time in a large C++ project?

查看:175
本文介绍了如何在大型C ++项目中检测编译时的瓶颈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想减少大型C ++项目的编译时间。
我试图使用预编译头,接口等
但在我继续前,我想知道是否有任何工具,帮助检测为什么编译时间是这么长。
有人建议pc-lint,我会给一个镜头。
我应该如何检测不必要的#include文件在一个大的C ++项目?
但是如果有其他工具,分析编译时间和谈论任何提示,以提高编译速度,让我知道。
提前感谢。

I want to reduce compile time of a large C++ project. I tried to use precompiled headers, interface and etc. But before I move on, I want to know whether any tool which helps detect why compile time is so long. Somebody suggests pc-lint and I will give a shot. How should I detect unnecessary #include files in a large C++ project? But if there are other tools which analysis compile time and talk about any hints to increase compile speed, let me know. Thanks in advance.

环境:Microsoft Visual Studio C ++ 2008或2010。

Environment : Microsoft Visual Studio C++ 2008 or 2010.

推荐答案

我喜欢的一种方法是查看你的几个源的预处理器输出 - 只是从编译器的角度读取一些,而不是有点抽象的表示,# inclu sion。很可能你会发现一些大块的includes / libraries你不需要,并不一定知道依赖/ include的存在(或需要)。从那里,决定哪些依赖可以删除。即使你的依赖关系是正确的,大输出也可以建议你如何将更大的模块分成更小的模块。

one approach i like is to review the preprocessor output of a few of your sources -- just read some of it from the compiler's perspective rather than the somewhat abstracted representation that is #inclusion. chances are you will find some large chunks of includes/libraries you don't need and weren't necessarily aware of the existence (or need) of the dependency/include. from there, decide which dependencies can be removed. even if your dependencies were all correct, large outputs can also suggest how you might approach dividing larger modules into smaller pieces.

这篇关于如何在大型C ++项目中检测编译时的瓶颈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆