Advantages of removing includes which are already in precompiled header?

巧了我就是萌 提交于 2020-01-17 03:14:07

问题


I'm aware of disadvantages, but is there an improvement in compile time when you clean your sources from #include statements which are already in precompiled header?

I understand that header guards (be it #pragma once or #ifdef guards) will ensure that headers which are redundant will be quickly skipped, but is there a slowdown when accessing the header file and checking for the guard? I'm working on quite big project and even minor speedups in small scale could help in big scale.


回答1:


In my test I inserted header files from precompiled header to the "Force include" field, but the compilation time was the same. So I don't think, than you can get any measurable benefit from removing includes.



来源:https://stackoverflow.com/questions/23683014/advantages-of-removing-includes-which-are-already-in-precompiled-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!