Lars Gullik Bjønnes wrote:
> | Andre Poenitz wrote:
>>> And we've lost a few dependency on ParagraphList_fwd.h.
> | which is a non-issue in my book since it drags in system files
> | only. Ok, ok, so you don't like <list>. I note that
> | support/types.h still drags in <vector>.
> 
> And I claim that you can drag in a bunch of headers without noticing
> any effect.
> 
> Time to stop this header phobia.

I agree, but only for system headers. Unnecessary project headers lead 
to the re-compilation of unnecessarily large chunks of the tree each 
time they are changed.

Anyway, let's see if we can back that up:

$ cat lars.C
#include <map>
#include <vector>
#include <string>
#include <list>

int main() {
        return 0;
}
$ time g++ -o lars lars.C

real    0m0.684s
user    0m0.420s
sys     0m0.030s

]$ cat andre.C
int main() {
        return 0;
}
$ time g++ -o andre andre.C

real    0m0.152s
user    0m0.150s
sys     0m0.000s

Conclusion: dragging in those headers costs half a second.

$ cd lyx/devel/src && find . -name '*.C' | wc -l
    818

Conclusion: the worst case is that this costs us 400secs on a full 
compile.

-- 
Angus

Reply via email to