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]

Compilation speed and builtin functions


Hi,

In "TREE_CODE mania" Devang Patel wrote:
> I collected profiled data for following one line program.
> 
> int foo() { return 1;}
> 
> Now, gprof tells me that to compile this, cc1 calls TREE_CODE_read()
> 37572 times! I was expecting that number to be in couple of thousands
> range but 37k seems high to me.

http://gcc.gnu.org/ml/gcc/2002-09/msg00121.html

What is silly in all this is that we build lots of trees that are 
completely useless.  For a small program as the one before, GCC builds 
all its builtins functions!  
What could be interesting to investigate is a demand driven construction 
of these builtin functions.

The following is a trace of the global tree starting with the current 
function and browsing through the builtins and defined types...
http://gcc.gnu.org/ml/gcc-patches/2002-10/msg01201.html

The Tree Browser is not yet available since I want to change its lexer 
implementation, but if someone asks I'll just send it as it is to gcc-patches.

You can count a total of 224 nodes in this global tree starting with the 
current function declaration.  I think that we can improve something in here,
and reduce the compile time of a foo function to what it should be :-)

Sebastian


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