How should I detect bottleneck of compile time in a large C++ project?

后端 未结 4 1522
暖寄归人
暖寄归人 2021-02-18 15:41

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 de

4条回答
  •  不要未来只要你来
    2021-02-18 16:20

    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.

提交回复
热议问题