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: Faster compilation speed: cache behavior


On Tuesday, August 20, 2002, at 03:47  PM, Matt Austern wrote:

One thing we've noticed at Apple---I don't know whether or
not this is conventional wisdom---is that the distribution of
node types is very uneven.  The top five tree node types
account for 50% of the storage!
Yes.

[/tmp]$ cat h.c
#include <stdio.h>

int main()
{
        printf ("Hello World\n");
        return 0;
}

For above program, top candidates are:

                        Number         Bytes     %Total
identifier_node         786              49k     35.143
tree_list               281            5620       4.276
function_decl           222              24k     18.918
integer_cst             132            4224       3.214
type_decl               118              12k     10.056

These five nodes count for 1539 nodes out of total 1947 nodes.
(86K Bytes out of 139K total bytes)
I am getting similar results for larger program with 150k nodes.

-Devang

Here is the full list of all nodes...

[bardoli.apple.com:/tmp]$ gcc3 -fmem-report h.c

Tree                 Number            Bytes    % Total
error_mark                1              16       0.011
identifier_node         786              49k     35.143
tree_list               281            5620       3.926
tree_vec                  2              32       0.022
block                     2             128       0.089
void_type                 3             336       0.235
integer_type             87            9744       6.807
real_type                 3             336       0.235
complex_type              4             448       0.313
vector_type              19            2128       1.487
boolean_type              1             112       0.078
pointer_type             38            4256       2.973
reference_type            1             112       0.078
array_type               25            2800       1.956
record_type              42            4704       3.286
union_type                2             224       0.156
function_type            99              10k      7.746
integer_cst             132            4224       2.951
function_decl           222              24k     17.370
type_decl               118              12k      9.233
var_decl                  4             448       0.313
parm_decl                 2             224       0.156
result_decl               2             224       0.156
field_decl               66            7392       5.164
component_ref             5             160       0.112
Total                  1947             139k

RTX                  Number            Bytes    % Total
expr_list                 2              32       0.249
insn                     35            1120       8.717
jump_insn                 7             448       3.487
call_insn                 1              64       0.498
barrier                   4              64       0.498
code_label                4             256       1.993
note                     10             320       2.491
parallel                  1               8       0.062
set                      40             640       4.981
use                       4              32       0.249
clobber                   3              24       0.187
call                      1              16       0.125
const_int               129            1032       8.032
const_double             21             672       5.230
const_vector             19             304       2.366
pc                        1               8       0.062
reg                      39             624       4.857
scratch                   1               8       0.062
mem                     224            3584      27.895
label_ref                 7             112       0.872
symbol_ref              394            3152      24.533
cc0                       1               8       0.062
if_then_else              3              48       0.374
compare                   3              48       0.374
plus                      9             144       1.121
ne                        1              16       0.125
eq                        1              16       0.125
ge                        1              16       0.125
lt                        1              16       0.125
sign_extend               1               8       0.062
zero_extend               1               8       0.062
Total                   969              12k

Size   Allocated        Used    Overhead
8           8192        7128         192
16            16k       5840         256
32            20k       6496         240
64            52k         50k        520
512         4096         512          32
112          116k         80k       1044
20            52k       5920         728
Total        268k        156k       3012

String pool
entries         786
identifiers     786 (100.00%)
slots           16384
bytes           8110  (4106  overhead)
table size      64k
coll/search     0.0139
ins/search      0.3407
avg. entry      10.32 bytes (+/- 6.10)
longest entry   38


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