From: Dan Nicolaescu <dann@godzilla.ics.uci.edu>
To: Robert Bowdidge <bowdidge@apple.com>
Cc: gcc@gcc.gnu.org
Subject: Re: cutting the size of CONST_DECLs
Date: Sat, 28 Feb 2004 01:09:00 -0000 [thread overview]
Message-ID: <200402280020.i1S0KZ4J006446@scanner2.ics.uci.edu> (raw)
In-Reply-To: <2B448A8E-6977-11D8-B63F-000A957D89DA@apple.com>
Robert Bowdidge <bowdidge@apple.com> writes:
> Hi, all,
>
> At Apple, the compiler's memory use (and its effect on compile speed)
> is our biggest concern. One specific worry is declarations. On
> common Mac programs which include headers for our GUI libraries,
> declarations fill a significant amount of garbage-collected memory.
> With -fmem-report, we usually see about 35% of memory filled with
> declarations.
> CONST_DECLs are an obvious offender in our programs; many of the Mac
> headers make heavy use of enums to define symbolic constants. In
> some programs, CONST_DECLS are the third most common kind of
> declaration after FUNCTION_DECL and PARM_DECL, and can be responsible
> for 30% of declarations and 10% of gc'd memory.
>
> I've tried one change to cut memory use: creating a new, smaller
> structure for CONST_DECLs only, and having all other declarations
> inherit this structure and extend it with the rest of the fields. On
> a couple typical applications, this change cuts memory use by 4-6% and
> compilation time by 0-3%.
You might also want to look at doing something about FUNCTION_DECLs. There are
a few fields in struct tree_decl that are only used for
FUNCTION_DECLs: inlined_fns, saved_tree. If you somehow reorganize
struct tree_decl and manage to leave these fields out for everything
but FUNCTION_DECLs you will get some memory savings.
Also "vindex" is only used for languages that use inheritance, so it
is useless for C. Moving "vindex" to "lang_specific" might be
interesting too.
next prev parent reply other threads:[~2004-02-28 0:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-28 0:21 Robert Bowdidge
2004-02-28 1:09 ` Dan Nicolaescu [this message]
2004-02-28 2:38 ` Robert Bowdidge
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=200402280020.i1S0KZ4J006446@scanner2.ics.uci.edu \
--to=dann@godzilla.ics.uci.edu \
--cc=bowdidge@apple.com \
--cc=gcc@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).