I am trying to use PCH in my solution to cut compilation time, but unbelievably, it takes more than twice as long with compared to without. Here's the stats:
Windows 7 x64 with 8GB running on i7
Sample project: 235 cpp files for a total of 4.5 MB source code (using MFC)
With PCH takes 13:55 minutes
Without PCH takes 6:15 minutes
I'm pretty sure I'm using them correctly, the project is set to Use Precompiled Headers at the project level, and the StdAfx.cpp is set to Create Precompiled Headers, through StdAfx.h
All standard #includes are placed in StdAfx.h, and all cpp files start with
#include "StdAfx.h"
I can't make sense of it. Anyone have an ideas what could be happening, or how I would even start to try to work it out?
g++
) and to pre-compile withg++
thatStdAfx.h
header file? – Basile Starynkevitch