public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Ronny Krashinsky" <ronny@mit.edu>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/8805: [3.2/3.3 regression] compile time regression with many member variables
Date: Thu, 12 Dec 2002 13:16:00 -0000	[thread overview]
Message-ID: <20021212211602.2498.qmail@sources.redhat.com> (raw)

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
 |
 


             reply	other threads:[~2002-12-12 21:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-12 13:16 Ronny Krashinsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-12-10 15:01 bangerth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021212211602.2498.qmail@sources.redhat.com \
    --to=ronny@mit.edu \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).