public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: Peter Barada <peter@the-baradas.com>
Cc: nathan@codesourcery.com,  richard.guenther@gmail.com,
	 stevenb@suse.de,  joseph@codesourcery.com,
	 ian@wasabisystems.com,  gcc@gcc.gnu.org
Subject: Re: Compiler uses a lot of memory for large initialized arrays
Date: Thu, 02 Dec 2004 17:39:00 -0000	[thread overview]
Message-ID: <41AF5335.50509@codesourcery.com> (raw)
In-Reply-To: <20041202172949.9C1119842C@baradas.org>

Peter Barada wrote:
>>>Or can't we seek in the asm output and overwrite previously written values?
>>>Might be slow, though.
>>
>>Even if that were sensible, where will we remember the file offsets
>>of each and every element :)

I think overwriting stuff in the assembler is a horrible idea.

I also think that trying to acheive 2.95.3 memory usage for huge arrays 
is foolish.  Since then, we've deliberately substantially increased the 
amount of memory we need for lots of things: function-at-a-time is more 
expensive than statement-at-a-time, and now we're unit-at-a-time for 
many compilations -- as we should be.  Most compilers suck up lots of 
memory with vast arrays; I don't think we need to be different, alleged 
regression or not.

However, the C++ front end (and perhaps the C front end) do some pretty 
silly stuff when contstructing the arrays.  I believe that when I 
analyzed this, I determined that there were factor-of-eight sorts of 
improvements possible.  That's what I think we should fix.

We've already got some of that, in that, for example, Nathan's changed 
things so that we share integer constants.  The next major step is to 
change CONSTRUCTOR to use an array, rather than a linked list, of 
elements for CONSTRUCTOR_ELTS.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304

  reply	other threads:[~2004-12-02 17:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-02 16:08 Ian Lance Taylor
2004-12-02 16:34 ` Joseph S. Myers
2004-12-02 17:03   ` Ian Lance Taylor
2004-12-02 17:05   ` Steven Bosscher
2004-12-02 17:12     ` Richard Guenther
2004-12-02 17:17       ` Nathan Sidwell
2004-12-02 17:29         ` Peter Barada
2004-12-02 17:39           ` Mark Mitchell [this message]
2004-12-02 17:42           ` Ian Lance Taylor
2004-12-02 17:49           ` Dave Korn
2004-12-02 17:36       ` Andreas Schwab
2004-12-02 18:18   ` Joe Buck
2004-12-02 18:23     ` Mark Mitchell
2004-12-02 17:31 ` Mark Mitchell
2004-12-02 17:33 ` Giovanni Bajo

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=41AF5335.50509@codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=gcc@gcc.gnu.org \
    --cc=ian@wasabisystems.com \
    --cc=joseph@codesourcery.com \
    --cc=nathan@codesourcery.com \
    --cc=peter@the-baradas.com \
    --cc=richard.guenther@gmail.com \
    --cc=stevenb@suse.de \
    /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).