From: Markus Trippelsdorf <markus@trippelsdorf.de>
To: Patrick Palka <patrick@parcs.ath.cx>
Cc: gcc-patches@gcc.gnu.org, jason@redhat.com
Subject: Re: [PATCH] Reuse the saved_scope structures allocated by push_to_top_level
Date: Thu, 03 Mar 2016 14:22:00 -0000 [thread overview]
Message-ID: <20160303142245.GA305@x4> (raw)
In-Reply-To: <1457014595-5593-1-git-send-email-patrick@parcs.ath.cx>
On 2016.03.03 at 09:16 -0500, Patrick Palka wrote:
> push_to_top_level gets called fairly frequently in template-heavy code
> that performs a lot of instantiations, and we currently "leak" a lot of
> GC memory when compiling such code since [push|pop]_to_top_level() do
> not bother reusing or even freeing each saved_scope structure it
> allocates.
>
> This patch makes push_to_top_level() reuse the saved_scope structures it
> allocates. This is similar to how begin_scope() reuses the
> cp_binding_level structures it allocates.
>
> This patch reduces the maximum memory usage of the compiler by 4.5%,
> from 525MB to 500MB, when compiling the Boost::Fusion test file
> libs/fusion/test/compile_time/transform.cpp from the Boost 1.60 testsuite.
>
> Bootstrapped and tested on x86_64-pc-linux-gnu, OK for
> trunk or for GCC 7?
Great. push_to_top_level also shows up very high in profiles when
building Chromium for example.
There is an old bug for this issue:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64500
--
Markus
next prev parent reply other threads:[~2016-03-03 14:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 14:16 Patrick Palka
2016-03-03 14:22 ` Markus Trippelsdorf [this message]
2016-03-03 14:49 ` Patrick Palka
2016-03-03 15:22 ` Manuel López-Ibáñez
2016-03-03 15:39 ` Patrick Palka
2016-03-03 16:01 ` Manuel López-Ibáñez
2016-04-18 1:49 ` Patrick Palka
2016-04-21 16:37 ` Jason Merrill
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=20160303142245.GA305@x4 \
--to=markus@trippelsdorf.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=patrick@parcs.ath.cx \
/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).