How do YOU reduce compile time, and linking time for Visual C++ projects (native C++)?

前端 未结 12 1187
深忆病人
深忆病人 2020-11-29 21:46

How do YOU reduce compile time, and linking time for VC++ projects (native C++)?

Please specify if each suggestion applies to debug, release, or both.

12条回答
  •  孤独总比滥情好
    2020-11-29 22:21

    Compile Time:
    If you have IncrediBuild, compile time won't be a problem. If you don't have a IncrediBuild, try the "unity build" method. It combine multiple cpp files to a single cpp file so the whole compile time is reduced.
    Link Time:
    The "unity build" method also contribute to reduce the link time but not much. How ever, you can check if the "Whole global optimization" and "LTCG" are enabled, while these flags make the program fast, they DO make the link SLOW.
    Try turning off the "Whole Global Optimization" and set LTCG to "Default" the link time might be reduced by 5/6.
    (LTCG stands for Link Time Code Generation)

提交回复
热议问题