This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC scalability wrt _extra_ large generated C files
- From: Jacques THOMAS <jthomas at cs dot purdue dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 07 Mar 2003 00:22:27 -0500
- Subject: GCC scalability wrt _extra_ large generated C files
Hi all,
I have some _extra_ large generated C source file which I would like to
compile with GCC. It is a huge zone of initialized data that looks
something like :
---------
/* file struct.h */
typedef struct {
void *field_1;
void *field_2;
void *field_3;
} bloated_1;
typedef struct {
void *field_1;
void *field_2;
void *field_3;
} bloated_2;
typedef struct {
void *field_1;
void *field_2;
void *field_3;
} bloated_3;
../..
typedef struct { ../..} bloated_n;
---------------
/* file struct.c */
#include "struct.h"
bloated_1 bloated_one_1 = {
&bloated_one_2,
&bloated_one_3,
&bloated_one_1,
};
bloated_2 bloated_one_2 = {
&bloated_one_2,
&bloated_one_3,
&bloated_one_1,
};
bloated_3 bloated_one_3 = {
&bloated_one_2,
&bloated_one_3,
&bloated_one_1,
};
../..
bloated_n bloated_one_n = { ../.. };
--------------
I observe that, as the size of the source file grows, GCC compile time
does not increase linearly at all. As I have 800k lines of code that I
can not (easily) split in separate files, it is a problem.
I have already increased the size of list_hash_table to 1M entries in
gcc/cp/tree.c in order to avoid spending time on growing the hash table.
That reduces the problem but doesn't solve it ; gcc is still far from
scalable.
I think the problem lies in the handling of lexical scopes as linked
lists (functions pushtag/lookup_tag from gcc/tree.c). Am I right ?
Any idea, pointer to existing work, etc. ... will be greatly appreciated.
TIA,
Jacques THOMAS.