This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: using stdc++.h.gch


> Date: Tue, 15 Apr 2003 12:23:53 -0500
> From: Benjamin Kosnik <bkoz at redhat dot com>
> Cc: law at redhat dot com, geoffk at geoffk dot org
> X-OriginalArrivalTime: 15 Apr 2003 17:25:23.0129 (UTC) FILETIME=[FF073290:01C30373]
> 
> 
> Geoff recently fixed the last issue with PCH support on linux. It is now
> possible to use pre compiled headers on linux. Doing so is a win, by
> quite a large margin.
> 
> for 'time make check-target-libstdc++-v3'
> 
> 20030415 pch
> 722.110u 89.320s 19:26.08 69.5% 0+0k 0+0io 5429730pf+0w
> 
> 20030415 no pch
> 1514.670u 108.510s 34:27.58 78.5%       0+0k 0+0io 2496245pf+0w
> 
> I expect similar results for the g++ testsuite.
> 
> I'm all about reclaiming 15 more minutes in my day (times x times I do
> make check) by using the precompiled header support. Also, if this is
> flipped on, more people will use PCH and thus it will get wider testing.
> 
> Attached is a patch that enables PCH by default, for all targets. I'd
> appreciate it if people could start testing with this patch and let me
> know the results. In particular, I'm curious about 64 bit linux systems,
> BSD, and Solaris.

Solaris is known to not-work, due to some weirdness in their mmap()
implementation.  I think the current situation is that there are two
possible design choices, one that is more portable but maybe slower,
and another that relies on fragile OS behaviour but would be fast when
it worked.

BSD is known to work (well, Darwin at least).

> Also, I have some questions and issues.
> 
> 1) What targets support PCH, and how can I identify this in autoconf?
> I'm assuming that PCH should not be flipped on for everybody, and that
> maybe an --enable flag will be needed, with hosts that support it
> getting it automagically fipped on?

If you did want to check PCH support with autoconf, I'd suggest trying
to build a PCH file and trying to use it.

> 2) At some point, -H needs to show that the .gch files is being used.
> What this means is still a bit up in the air.
> 
> 3) Installing a zero-size stdc++.h file so that I can use stdc++.h.gch
> seems weird. Is it possible to just do some kind of -include
> /foo/stdc++.gch?

You don't need to have a stdc++.h file to use stdc++.h.gch; and
-include does work, although remember that you have to leave the .gch off.

-- 
- Geoffrey Keating <geoffk at geoffk dot org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]