问题
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