Re: One Big (std::) Header File?

From: Steven T. Hatton (susudata_at_setidava.kushan.aa)
Date: 10/22/04


Date: Fri, 22 Oct 2004 03:59:14 -0400

Chris Theis wrote:

> In general you should only include the headers that are really required,
> although with precompiled headers the story is a little different as you
> say.

I'm inclined to take the approach of creating a project_std.hh that contains
the standard headers used by the entire project. I don't like the idea all
that much. I very much believe in isolating components as much as
possible. OTOH, if compile times are going to be sensitive to the order in
which headers are included, trying to manage that on a file-by-file basis
throughout a project is probably a bad idea.

> If your build process is still too slow, have you thought about a
> parallel build?

That depends what you mean. I kick of multiple processes when I build, but
I haven't attempted sharing the load between systems. I don't know how
much getting my hyperthreading to work might impact the build times. As I
said in another post, I'm not able to really experiment with the recently
introduced pre-compiled header support in GCC, so I can't comment on
whether it would make a significant difference. I do believe the KDE folks
may have done some things to speed up the build process. But I haven't
been building the entire cvs image lately, so that's not an immediate
issue.

-- 
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell


Relevant Pages

  • Re: [Patch] Always include
    ... If you are working on improving compile times, ... If just removing "extern"s from prototypes ... reducing headers can do wonders. ... struct super_block; ...
    (Linux-Kernel)
  • Re: Order of #includes
    ... > library headers later. ... > libraries they use already. ... I think that the pros outweigh the cons. ... This doesn't seem to be affecting compile times seriously. ...
    (comp.lang.cpp)
  • Re: One Big (std::) Header File?
    ... Catalin Pitis wrote: ... > Include only the necessary headers. ... the KDE I'm running. ... then our deductions constitute mathematics. ...
    (comp.lang.cpp)