From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [RFC] Populate seen_names hash in cooked_index_shard::do_finalize
Date: Fri, 10 Feb 2023 07:21:32 -0700 [thread overview]
Message-ID: <20230210142132.2039087-1-tromey@adacore.com> (raw)
Hannes pointed out that cooked_index_shard::do_finalize never
populates the seen_names hash table. This patch adds the necessary
store. This reduces memory use a little for "gdb gdb":
(before) Space used: 28909568 (+0 for this command)
(after) Space used: 28884992 (+0 for this command)
... about 24k. So maybe it's better to just remove this hash?
What this means, btw, is that in gdb there are not many symbols that
are both mentioned in many CUs and that also require name
canonicalization. It's possible this would differ in other programs.
---
gdb/dwarf2/cooked-index.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
index 3d23a65ad8f..71852237f98 100644
--- a/gdb/dwarf2/cooked-index.c
+++ b/gdb/dwarf2/cooked-index.c
@@ -356,6 +356,7 @@ cooked_index_shard::do_finalize ()
entry->canonical = canon_name.get ();
m_names.push_back (std::move (canon_name));
}
+ *slot = entry;
}
else
{
--
2.39.1
next reply other threads:[~2023-02-10 14:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 14:21 Tom Tromey [this message]
2023-03-27 14:14 ` Tom Tromey
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=20230210142132.2039087-1-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.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).