Pregunta

I am working on a visual studio project with precompiled headers (stdafx.h , directive Use, directive Create). Aside of external headers which are used almost all the time, there are more than 50 headers from the project itself in stdafx.h.

I would like to know whether a clean build would be slower or faster without the precompiled header. Unfortunately to try I would have to heavily modify the whole project (I will eventually, because coupling is an issue).

¿Fue útil?

Solución

a precompiled header build would be faster if the header in the pch are used multiple time in the project. since that header is compiled only once it cannot be slower than compiling the included headers over and over again.

the big drawback of pch's is that they hide dependencies and result in forgotton includes in your header files. So if someone wants to use your library it may get many missing includes.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top