S
Stuart MacMartin
Looking for tricks for speeding up builds...
We have an application with about 970 of our own classes of various
sizes plus a fair number of routines. Over the past year the
compile/link time has been slowing down on PC (MFC dev studio 6) and on
linux. Link time on PC seems to depend on RAM - a new desktop machine
with 2Gb of RAM compiles and links significantly faster than a three
year old laptop with 1/2 Gb of RAM but same processor speed.
Over the past year or so we've been using more templates and more STL.
We also have more classes, but I don't think the size of the project
fully accounts for the slowdown.
Tricks we use:
- On PC, precompiled header file includes often used things like
stingray include files; on Unix this is bypassed (although I understand
gcc now supports it?)
- We appropriately minimize cascading include files (member variables
are typically pointers, except where judiciously chosen not to be)
- I've started hiding some implementations further by pimpl, especially
dialogs used where the full dialog support classes aren't otherwise
needed anyway
Q: Are there any other tricks?
Q: Can proper use of namespaces help?
Q: Is there an issue with stl or templates with respect to build times?
Q: We haven't really seen the need to split the project up into
libraries. Can this help (and if so, why?)
Stuart
We have an application with about 970 of our own classes of various
sizes plus a fair number of routines. Over the past year the
compile/link time has been slowing down on PC (MFC dev studio 6) and on
linux. Link time on PC seems to depend on RAM - a new desktop machine
with 2Gb of RAM compiles and links significantly faster than a three
year old laptop with 1/2 Gb of RAM but same processor speed.
Over the past year or so we've been using more templates and more STL.
We also have more classes, but I don't think the size of the project
fully accounts for the slowdown.
Tricks we use:
- On PC, precompiled header file includes often used things like
stingray include files; on Unix this is bypassed (although I understand
gcc now supports it?)
- We appropriately minimize cascading include files (member variables
are typically pointers, except where judiciously chosen not to be)
- I've started hiding some implementations further by pimpl, especially
dialogs used where the full dialog support classes aren't otherwise
needed anyway
Q: Are there any other tricks?
Q: Can proper use of namespaces help?
Q: Is there an issue with stl or templates with respect to build times?
Q: We haven't really seen the need to split the project up into
libraries. Can this help (and if so, why?)
Stuart