This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Compile time
Hi Satya,
In my experience, long compile times usually occur due to poor software
engineering regarding the build.
For a good book on the subject, please read "Large-Scale C++ Software
Design" by John Lakos.
For a good essay on just makefiles, please read "Recursive Make Considered
Harmful" by Peter Miller, at
<http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html>. Many
makefiles commit two cardinal sins: 1) build too much (thus takes too
long), 2) doesn't build enough (thus unreliable unless a clean-build is
done, the usual culprit being failure to track dependencies).
Some tips:
NEVER include a header file that is not needed by the compilation unit.
ALWAYS include every header file required by the source or header files.
CONSIDER using header-header files, which contain a bare bones subset of a
header file, primarily for other header files.
CONSIDER implementing the "pimpl" pattern (pointer to implementation), to
help disassociate the implementation from the interface and reduce often
unnecessary "cascade recompiles".
HTH,
--Eljay