public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: hzoli@hzoli.2y.net
To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: c/10675: Compile time increases quadratically with struct size
Date: Thu, 08 May 2003 01:56:00 -0000	[thread overview]
Message-ID: <E19DaXZ-0002hC-00@hzoli.austin.ibm.com> (raw)


>Number:         10675
>Category:       c
>Synopsis:       Compile time increases quadratically with struct size
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 08 01:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Zoltan Hidvegi
>Release:        3.2.3 (Debian testing/unstable)
>Organization:
>Environment:
System: Linux hzoli 2.4.21-rc1-ac3 #1 Wed Apr 30 11:10:22 CDT 2003 i686 unknown unknown GNU/Linux
Architecture: i686

host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
>Description:
The compile time increases quadratically (actually more than
quadratically) with the number of members in a struct.

>How-To-Repeat:
The following is a shell script that will generate a struct with a
given number of members and instantiates a global variable of that
type:

------- BEGIN biggen.sh -------------
#! /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;'
--------- END biggen.sh -------------

Run it like this:
./biggen.sh 10000 > big.c; cc -c big.c
Change the number from 10000 and see how the compile time is affected.
E.g. on my 1.73GHz Athlon, 5000 members take 1.66s, 10000 takes 8.5s and 20000
takes 35.91s.  Unfortunately, I need to compile a generated struct
with several hundred thousand members, which is not feasible.

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-05-08  1:56 UTC|newest]

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

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=E19DaXZ-0002hC-00@hzoli.austin.ibm.com \
    --to=hzoli@hzoli.2y.net \
    --cc=debian-gcc@lists.debian.org \
    --cc=gcc-gnats@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).