This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: gcc compile-time performance




--On Saturday, May 18, 2002 04:44:31 PM -0400 Robert Dewar <dewar@gnat.com> 
wrote:

> <<In C++, for real programs, I've seen tree images as large as 5
> gigabytes.
>>>
>
> 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
away.

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
back end.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


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