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.


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.