[jamming] Jam2.5 and precompiled headers

Chris Antos chrisant at windows.microsoft.com
Sat Feb 1 12:02:29 PST 2003

I got roughly 50% performance gain simply from using precompiled
headers; i.e. I cut my build time basically in half.  You can
potentially get less or more improvement depending on what your
precompiled header actually includes; i.e. how much redundant processing
is offloaded into the pch.  Take an additional 10% for batch
compilation, and that's in the neighborhood of the gain you're seeing
from turning the whole library into a single .c file.  You're right,
it's not always possible.  Some other drawbacks are that it can make
several things very difficult and you may get very poor linker
optimization results, and may have a lot of dead code left in the
executable, bogus DLL dependencies, and etc.

By the way, to solve the multiple compiler processes blocking each other
from accessing the pdb file, use the /Z7 compiler flag instead of /Zi.

-----Original Message-----
From: Matt Armstrong [mailto:matt at lickey.com] 
Sent: Saturday, February 01, 2003 8:56 AM
To: Chris Antos
Cc: Jacob Gorm Hansen; jam mailling list

"Chris Antos" <chrisant at windows.microsoft.com> writes:

> I said you get maximum win from batch compilation WHEN YOU USE
> PRECOMPILED HEADERS.  :-)  (caps to add visibility to key point)

Interestingly, I see performance gains of 70-80% when a whole library
is turned into a single .c file (e.g. add one .c file that #includes
all the others and compile that).

Unfortunately this doesn't always work, given the semantics of a C
compilation unit.

> Between batch compilation and precompiled headers, the latter gives
> a bigger win.  Combining the two gains some additional improvements

I've also looked into trying to get visual c++ to support parallel
builds (-j 2).  Unfortunately, the compiler barfs because it wants to
build a .pdb file.  :-(

More information about the jamming mailing list