This is the mail archive of the
mailing list for the GCC project.
Re: gcc compile-time performance
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Robert Dewar <dewar at gnat dot com>, "jss at ast dot cam dot ac dot uk" <jss at ast dot cam dot ac dot uk>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sat, 18 May 2002 14:06:05 -0700
- Subject: Re: gcc compile-time performance
- References: <20020518204431.3979EF28D4@nile.gnat.com>
--On Saturday, May 18, 2002 04:44:31 PM -0400 Robert Dewar <firstname.lastname@example.org>
> <<In C++, for real programs, I've seen tree images as large as 5
> Yes, that's common in Ada too, after all I just gave you the tree size
> from 4000 lines of code. But reading a 5 gigabyte file will take a heck
> of a long time in itself, so that sounds a bit ominous as well.
Ah -- but you don't have to read it. In general, you mmap it and
access it randomly. And in your main program you tend not mention
most of that stuff, so you don't touch anywhere near 5 GB of data.
> <<Not true; in C++ function bodies are present in the headers and the
> precompiled header may store the already optimized form of the code.
> why would you put functoin bodies of sufficient complexity not to be
> inlined in headers, sounds a peculiar coding technique to me, but then
> a lot of stuff in that world strikes me as peculiar :-)
Welcome to the world of templates.
Some of these functions are designed to be inlined, even though they
are complex; the trick is that when they are inlined they will collapse
Remember that the whole technique involved here is to force the compiler
to do a variety of domain-specific optimizations that it would not
otherwise do. The reason your front end/back end distinction doesn't
work here is that the front end is doing as much optimization as the
Mark Mitchell email@example.com
CodeSourcery, LLC http://www.codesourcery.com