This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Compilation speed and builtin functions
- From: Pop Sébastian <pop at gauvain dot u-strasbg dot fr>
- To: mrs at apple dot com, dpatel at apple dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 20 Oct 2002 10:23:12 +0200
- Subject: 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