public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Zoltan Hidvegi <hzoli@hzoli.2y.net>
To: rth@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c/10675: Compile time increases quadratically with struct size
Date: Mon, 12 May 2003 22:16:00 -0000	[thread overview]
Message-ID: <20030512221600.30818.qmail@sources.redhat.com> (raw)

The following reply was made to PR c/10675; it has been noted by GNATS.

From: Zoltan Hidvegi <hzoli@hzoli.2y.net>
To: rth@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, 
 hzoli@hzoli.2y.net, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c/10675: Compile time increases quadratically with struct size
Date: Mon, 12 May 2003 17:06:29 -0500 (CDT)

 --ELM1052777189-18480-0_
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain; charset=US-ASCII
 
 > Synopsis: Compile time increases quadratically with struct size
 > 
 > State-Changed-From-To: analyzed->closed
 > State-Changed-By: rth
 > State-Changed-When: Mon May 12 03:32:46 2003
 > State-Changed-Why:
 >     http://gcc.gnu.org/ml/gcc-patches/2003-05/msg00989.html
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10675
 
 I've applied the patch to the gcc-3.3 and manually fixed the
 conflicts.  This does indeed fix the compile-time with gcc, but g++
 still behaves quadratically.  Also for C++ you may want to run the
 attached biggen3.sh, that will generate a struct as before, but it
 adds a constructor that zero-initializes all members.  This also have
 unusually large, although linear memory usage, e.g., the compile of a
 struct with 25000 members with constructor initializers needs 55M
 (based on the memory use showed by top on both AIX and Linux).  And
 even C still seems to have slow lookups, as if the hash is only used
 to detect duplicates, but for member lookup it still uses linear
 search.  Run the attached biggen5.sh to test this, it will create a C
 struct and a function that initializes the struct.  Because of all
 this, I'd like to reopen this bug, or should I open a new bug?
 
 Zoli
 
 --ELM1052777189-18480-0_
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain
 Content-Disposition: attachment; filename=biggen3.sh
 Content-Description: 
 
 #! /bin/sh
 let i=0
 echo 'struct foo {'
 while [ "$i" -lt "$1" ]
 do
     echo "    int i_$((i=i+1));"
 done
 echo "    int junk;"
 let i=0
 echo '    foo() :'
 while [ "$i" -lt "$1" ]
 do
     let 'i=i+1'
     echo "	i_$i(0),"
 done
 echo "	junk(0) {}"
 echo '};'
 echo 'struct foo f;'
 
 --ELM1052777189-18480-0_
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain
 Content-Disposition: attachment; filename=biggen5.sh
 Content-Description: 
 
 #! /bin/sh
 let i=0
 echo 'struct foo {'
 while [ "$i" -lt "$1" ]
 do
     echo "    int i_$((i=i+1));"
 done
 echo '};'
 #echo 'struct foo f;'
 
 let i=0
 echo 'void init_foo(struct foo *p) {'
 while [ "$i" -lt "$1" ]
 do
     echo "    p->i_$((i=i+1)) = 0;"
 done
 echo '}'
 
 --ELM1052777189-18480-0_--


             reply	other threads:[~2003-05-12 22:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-12 22:16 Zoltan Hidvegi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-05-12 22:26 Richard Henderson
2003-05-12  3:32 rth
2003-05-09  1:25 rth
2003-05-08 22:34 ehrhardt
2003-05-08  1:56 hzoli

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=20030512221600.30818.qmail@sources.redhat.com \
    --to=hzoli@hzoli.2y.net \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=rth@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).