public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8805: [3.2/3.3 regression] compile time regression with many member variables
@ 2002-12-10 15:01 bangerth
0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2002-12-10 15:01 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, ronny
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/8805: [3.2/3.3 regression] compile time regression with many member variables
@ 2002-12-12 13:16 Ronny Krashinsky
0 siblings, 0 replies; 2+ messages in thread
From: Ronny Krashinsky @ 2002-12-12 13:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8805; it has been noted by GNATS.
From: "Ronny Krashinsky" <ronny@mit.edu>
To: <bangerth@dealii.org>, <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>,
<nobody@gcc.gnu.org>, <ronny@mit.edu>, <gcc-gnats@gcc.gnu.org>
Cc:
Subject: Re: c++/8805: [3.2/3.3 regression] compile time regression with many member variables
Date: Thu, 12 Dec 2002 16:12:35 -0500
Thank you for the response.
Based on your example, I did some more investigation and determined that the
problem seems to be due to the interaction between member objects with
destructors and C++ exception handling. I've come to this conclusion because
the non-linear increase in compile time does not occur when I compile with
"-fno-exceptions". This makes some amount of sense because C++ states that if
an exception occurs in the middle of initializing the members
in an object's constructor, then the destructor is called for all the members
that have already been constructed. This is an n^2 sort of thing, so it could
be why the compile times were scaling non-linearly with the number of members.
So, it seems like this is probably not a bug, but it would be great if gcc were
better at dealing with code like this. And, I think that it can still be
considered a regression since gcc 2.95 is so much faster.
I don't have write access to the problem report database, so I have not updated
the report.
Thanks,
Ronny
----- Original Message -----
From: <bangerth@dealii.org>
To: <gcc-bugs@gcc.gnu.org>; <gcc-prs@gcc.gnu.org>; <nobody@gcc.gnu.org>;
<ronny@mit.edu>
Sent: Tuesday, December 10, 2002 6:01 PM
Subject: Re: c++/8805: [3.2/3.3 regression] compile time regression with many
member variables
| 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=88
05
|
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-12 21:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-10 15:01 c++/8805: [3.2/3.3 regression] compile time regression with many member variables bangerth
2002-12-12 13:16 Ronny Krashinsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).