This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [gnat] reuse of ASTs already constructed
- From: Geert Bosch <bosch at gnat dot com>
- To: Oliver dot Kellogg at t-online dot de (Oliver Kellogg)
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 4 Mar 2003 14:56:38 -0500
- Subject: Re: [gnat] reuse of ASTs already constructed
On Tuesday, Mar 4, 2003, at 11:57 America/New_York, Oliver Kellogg
wrote:
I think it's a terrible waste that gnat1 can only process
one single file.
If gnat1 could be invoked with (for example) all the files
that gnatmake finds to need recompilation, that could
give tremendous compilation time savings - by keeping the
syntax trees of units compiled for reuse by further units.
Many Ada projects have large package specs that tend
to be pervasively used. (The GNAT compiler is itself
an example of such a design.) These applications
could benefit a lot from in-memory AST reuse.
What do you think about this?
This is not a new idea, and indeed there have been
thoughts for implementing some sort of scheme like
this. However, even though this may seem relatively
simple at first, the problems are in the details
and this is a bigger project than you might think.
Also, in most typical development schemes, only a
few units are recompiled at a time, and the back end
takes significantly more time than the front end anyway.
This means potential speedup is not "tremendous".
For example, for the run time library, about 30% of the
time is spent in the front end. The time building AST's
is a fraction of that, say 70% at most. Even in the
hypothetical case we could speed this up by a factor of
three, this still would gain us just 14% in overall speed
of the compiler. Significant sure, but not tremendous.