Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top