public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFC] Populate seen_names hash in cooked_index_shard::do_finalize
@ 2023-02-10 14:21 Tom Tromey
  2023-03-27 14:14 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2023-02-10 14:21 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC] Populate seen_names hash in cooked_index_shard::do_finalize
  2023-02-10 14:21 [RFC] Populate seen_names hash in cooked_index_shard::do_finalize Tom Tromey
@ 2023-03-27 14:14 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-03-27 14:14 UTC (permalink / raw)
  To: Tom Tromey via Gdb-patches; +Cc: Tom Tromey

>>>>> "Tom" == Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> Hannes pointed out that cooked_index_shard::do_finalize never
Tom> populates the seen_names hash table.  This patch adds the necessary
Tom> store.  This reduces memory use a little for "gdb gdb":

I'm going to check this in, and also backport it to the gdb 13 branch.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-27 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 14:21 [RFC] Populate seen_names hash in cooked_index_shard::do_finalize Tom Tromey
2023-03-27 14:14 ` Tom Tromey

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).