Re: Multi Threading Options



On Thu, 2 Jun 2005 18:05:49 +0100, Mark Randall wrote:

> In Update:
>
> I have now merged about 15 of the files, unfortunately merging the rest
> would create a managability nightmare beyond all proportions. I have also
> turned off both antivirus - Build time has dropped to approx 1 minute 20.

Just out of curiosity, which made the difference? If I ask you to vary one
thing at a time, it's with hopes the advice will rub off on me. :)

I would bet someone out there has created or at least researched a program
that combines dependency and context analysis with profiling and uses this
information to formulate a "build plan". The idea would be to feed the
compiler the largest chunks of source possible, combining pieces from
different source files, in order to minimize per-file overhead for multiple
file builds while not killing true incremental builds, and while still
preserving language semantics. Without such a build system, you're reduced
to devising something like this by hand:

// bundle1.cpp - this is what goes into your project
#include "file1.cpp"
#include "file2.cpp"
#include "file3.cpp"

This is a pain in the neck and rarely worth doing, but when it works, it
can help a lot.

> I have also checked that PCH is included, and it is being used...
>
> All headers are #pragma once'd
>
> Futher changes:
>
> Removed afxwin.h from all classes - No change.
>
> It could just be my huge use of afxtempl.h that is causing it? Although this
> should be compiled just 1 time and placed in the stdafx.

Templates will be instantiated as needed wherever they're used, which
definitely contributes to compile times. You can try identifying the
specializations you use and explicitly instantiate them, which in theory
should reduce compile times. Whether it will be worthwhile for your usage
pattern I couldn't say.

--
Doug Harrison
Microsoft MVP - Visual C++
.