This is the mail archive of the
mailing list for the GCC project.
HUGE compilation time / memory requirement in compilation of single file
- From: Janne Karhunen <Janne dot Karhunen at pp dot htv dot fi>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 27 Sep 2003 13:24:38 +0300
- Subject: HUGE compilation time / memory requirement in compilation of single file
We've got an application consisting of roughly one million lines
of C++ code, and it compiles and runs at least in linux (g++),
windows (MSVC++) and Solaris (Forte). We now have a weird
situation with two of our files that i can't instantly figure out
whether to report them as a bug in g++ or not.
Other one being relatively big file (~ 2000LOC) having one single
class inside that is using high number of inline functions. It
takes about 4 hours to compile this file with a 2.8GHz xeon (it's
a dual CPU system) with 4GB of RAM. This happens regardless of
whether it's just unoptimized (just -g) or optimized (-g -O2)
Other one is somewhat similar, except that it doesn't take that
much time, but it almost runs out of 32 bit memory address space
while compiling the file. 3GB of memory wasn't enough to compile
this single file. Amount of inlined stuff in this case wasn't
that big, but the class had huge nested switch-case structures
inside methods. Adjusting size of these switches had a direct
relation to amount of memory consumed during compilation. This
seems to happen only with optimized builds.
In both of these cases output seems valid, and program runs as
it's supposed to. Tested gcc/g++ versions are 3.3 and 3.3.1. Both
of these files compile just as you would expect them to, on any
other compiler tried (icc, MSVC++, Forte). So the question is,
can these be regarded as 'normal' behaviour, or should i start to
build up a testcase out of them?