This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8805: [3.2/3.3 regression] compile time regression with many member variables
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, ronny at mit dot edu
- Date: 10 Dec 2002 23:01:47 -0000
- Subject: Re: c++/8805: [3.2/3.3 regression] compile time regression with many member variables
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, ronny at mit dot edu, gcc-gnats at gcc dot gnu dot org
Old Synopsis: very long (non-linear) compile times for an object with many vector<int> members, possibly due to template instantiation
New Synopsis: [3.2/3.3 regression] compile time regression with many member variables
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Tue Dec 10 15:01:46 2002
State-Changed-Why:
Confirmed. A simpler testcase using only (nearly) empty
classes (but made non-POD) is attached. Compile times can be
made very large by removing the comment signs of a larger
part of the block of member variables. Here are some timings:
N=500: gcc2.95: 1s gcc3.3: 5s
N=1000: gcc2.95: 4s gcc3.3: 20s
So I see a relatively good N**2 behavior, but the
constant is significantly worse than for 2.95, so I
rate this a regression. gcc3.2 is somewhere in between,
about 3 times slower than 2.95, but 25 per cent faster
than 3.3CVS.
One can play interesting games with this testcase: if
I _reduce_ the complexity by replacing this code:
-----
struct vector { ~vector(); };
struct C { C();
vector x; };
struct A {
A();
typedef C T;
//...
------
by
----
struct vector { ~vector(); };
struct C { C();
vector x; };
struct A {
A();
typedef vector T;
---
(i.e. bypassing the C-class), then the compile times
_increase_ by a factor of 2 to 3. I would really be
interested in hearing an explanation of this phenomenon!
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8805