public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eljay Love-Jensen <eljay@adobe.com>
To: Exxos Sir <thomastrewas@yahoo.fr>, gcc-help@gcc.gnu.org
Subject: Re: Compiling on MacOSX is too long
Date: Thu, 02 Sep 2004 11:48:00 -0000	[thread overview]
Message-ID: <6.1.2.0.2.20040902063922.01e9a0d8@iplan-mn.corp.adobe.com> (raw)
In-Reply-To: <20040902083230.53248.qmail@web50102.mail.yahoo.com>

Hi,

 >The builds are too long.

Some builds take a long time.

There are several techniques you can employ to reduce build times.

+) In your header files, try to use forward references where possible, 
instead of including the header files.

+) To improve on #1, make "header-header" files.  These files contain the 
forward references, and maybe a smattering of other public facilities (such 
as enums).  Use the header-headers in your header files.  The header that 
that the header-header represents should be the first thing included by the 
actual header file.

+) Put guards in all your header files.

+) Include all the headers (or header-headers) that your header or source 
file requires.  Do not include anything beyond that!

+) Do not make "kitchen sink header files", which include everything.

+) Used the "pointer-to-implementation" technique (the "pimpl pattern"), to 
reduce rebuild time.

+) Follow Lako's suggestions, Large-Scale C++ Software Design 
<http://www.amazon.com/exec/obidos/tg/detail/-/0201633620>.

+) Follow Peter Miller's suggestions, Recursive Make Considered Harmful 
<http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html>.

HTH,
--Eljay

      reply	other threads:[~2004-09-02 11:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-02  8:32 Exxos Sir
2004-09-02 11:48 ` Eljay Love-Jensen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6.1.2.0.2.20040902063922.01e9a0d8@iplan-mn.corp.adobe.com \
    --to=eljay@adobe.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=thomastrewas@yahoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).