public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Precompiled headers
@ 2003-11-02 10:20 Robert Vazan
  2003-11-03  7:36 ` Per Bothner
  2003-11-03 20:14 ` Mike Stump
  0 siblings, 2 replies; 15+ messages in thread
From: Robert Vazan @ 2003-11-02 10:20 UTC (permalink / raw)
  To: gcc

Hi,

I've got tired of lenghty compilations and decided to do something about
it. As expected, precompiled headers have been discussed several times,
some attempts were made and something gets into 3.4 release.

From various comments, I judge that it just dumps compiler state into gch
file and reloads it for next source file. It is rumoured to give six times
faster compilations. Improvement from 12 to 2 minutes is not enough for me,
not to mention that simplified header structure means 2-3 times more
recompiling. I need it under one second.

My strategy is to track dependencies down to inidividual function
declarations and structures. Then diff changes in parsed headers and
rebuild only those files that really depend on modified statements. If
there is just one typedef added without name conflict, nothing is rebuilt.

One option is to work over plain sources, but here I get into complexities
of various languages and I cannot make it work anywhere but in C. Other
option is to use one of compiler's internal structures, that abstract away
most of C++ mess into easy to trap lookups. I am not Gcc developer, but I
have weird feeling that current sources aren't doing such nice database
lookups, that I could hang on. I am not going to rewrite half the compiler,
of course.

So what would you recommend to me? Is there any small part of compiler that
"sees" all dependencies as the code is compiled? I can make dependency
tracker for C easily as external program. Are there any libs that could
help me? I know about incremental linking and constant linking, but
dependencies are going to make biggest difference right now.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Precompiled headers
@ 2002-06-24 12:37 Noel Yap
  0 siblings, 0 replies; 15+ messages in thread
From: Noel Yap @ 2002-06-24 12:37 UTC (permalink / raw)
  To: gcc

I found in the archive talk about precompiled headers
but this talk looks like it died out 2 1/2 years ago. 
Is the work continuing behind the scenes?

I'm thinking of the following:

1. If there were an option, say --perform-includes,
that would process only the #includes, one header file
could be generated for each sub-lattice in the include
hierarchy.

Pros:
  A. Would greatly decrease the number of opened files
within a large project.
  B. Transparent to programmers but may need changing
of makefiles (see below).
  C. Since makefiles can know the dependencies of
header files, they can have the responsibility of
updating these new header files.  I think this would
imply that another flag, say --preparsed-include=path,
would need to exist so that the build may tell cpp
where these files are.  In the end, cpp doesn't need
to know about dependencies -- it'll use the preparsed
header if and only if it's there.
  D. System headers that are preparsed in this way can
be shared by everyone.

Cons:
  A. Requires a lot of disk space.

2. If there were an option, say
--keep-macro-definitions, that does everything that
cpp already does except that it keeps #define's, a
cheap form of pre-compiled headers can be achieved.

Pros:
  A. This shouldn't be a difficult change since it
should just be a matter of not doing something.

Cons:
  A. Requires a lot of disk space.

The above two have gone by the requirements:
1. Coding conventions must not be changed.
2. Large-project builds should improve in speed.
3. Small-project builds should not be affected.

Any comments?

Thanks,
Noel

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Precompiled headers...
@ 2001-06-28  6:06 Rob Taylor
  0 siblings, 0 replies; 15+ messages in thread
From: Rob Taylor @ 2001-06-28  6:06 UTC (permalink / raw)
  To: Gcc@Gcc. Gnu. Org

I seem to have lost track.. who is doing the integration of the PCH code into
the main tree? how's it going?

Thanks,
Rob Taylor

^ permalink raw reply	[flat|nested] 15+ messages in thread
* precompiled headers
@ 2001-04-04 15:38 Szasz Pal
  2001-04-04 16:13 ` Neil Booth
  2001-04-04 17:09 ` Jeff Sturm
  0 siblings, 2 replies; 15+ messages in thread
From: Szasz Pal @ 2001-04-04 15:38 UTC (permalink / raw)
  To: gcc

Hello!

I started to develop a program using Qt and Kde, but the compilation is very 
slow. For example for a source it takes 10 secs, although the sorce isn't big.
I observed that it takes about 9 secs just to compile the header files.
The gcc doesn't have something like 'precompiled headers' like borland & 
watcom c++ had?? It would spead up the compilation of a a lots of programs

bye
Pali



______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.email.ro/

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Precompiled Headers
@ 1998-11-09 21:55 Chad Gatesman
  0 siblings, 0 replies; 15+ messages in thread
From: Chad Gatesman @ 1998-11-09 21:55 UTC (permalink / raw)
  To: egcs

I was wondering if there has been any talk of adding the ability to
create pre-compiled headers to egcs?
If not, may I make such a suggestion?  What do others think of this?

Please CC me any responses, for I have trouble keeping up with this list
with all the other lists I am a part of.  Thank You.

--
Chad Gatesman
Software Engineer
Bristol Technology




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-11-14 13:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-02 10:20 Precompiled headers Robert Vazan
2003-11-03  7:36 ` Per Bothner
2003-11-03 20:14 ` Mike Stump
2003-11-07 14:38   ` Robert Vazan
2003-11-07 20:18     ` Mike Stump
2003-11-08 16:43       ` Robert Vazan
2003-11-11  0:22         ` Mike Stump
2003-11-14 15:07           ` Robert Vazan
2003-11-07 20:22     ` Mike Stump
  -- strict thread matches above, loose matches on Subject: below --
2002-06-24 12:37 Noel Yap
2001-06-28  6:06 Rob Taylor
2001-04-04 15:38 precompiled headers Szasz Pal
2001-04-04 16:13 ` Neil Booth
2001-04-04 17:09 ` Jeff Sturm
1998-11-09 21:55 Precompiled Headers Chad Gatesman

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).