From: "Christian Biesinger (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Christian Biesinger <cbiesinger@google.com>, gdb-patches@sourceware.org
Subject: [review] Create a correctly-sized demangled names hashtable
Date: Mon, 18 Nov 2019 23:24:00 -0000 [thread overview]
Message-ID: <20191118232414.501FA2816F@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1574118864000.I1f074d38e1d90af58705ec852f90c84cc034cd2e@gnutoolchain-gerrit.osci.io>
Christian Biesinger has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/686
......................................................................
Patch Set 1:
(1 comment)
| --- gdb/symtab.c
| +++ gdb/symtab.c
| @@ -771,10 +771,17 @@ create_demangled_names_hash (struct objfile_per_bfd_storage *per_bfd)
| Choosing a much larger table size wastes memory, and saves only about
| - 1% in symbol reading. */
| + 1% in symbol reading. However, if the minsym count is already
| + initialized (e.g. because symbol name setting was deferred to
| + a background thread) we can initialize the hashtable with that
| + count, because we will almost certainly have at least that
| + many entries. If we have a nonzero number but less than 256,
| + we still stay with 256 to have some space for psymbols, etc. */
| +
| + int count = std::max (per_bfd->minimal_symbol_count, 256);
PS1, Line 779:
Looking at hashtab.c, I should perhaps do something like
((minimal_symbol_count+2)/3)*4, to more completely avoid hashtable
resizings. Let me know if you have thoughts on that.
|
| per_bfd->demangled_names_hash.reset (htab_create_alloc
| - (256, hash_demangled_name_entry, eq_demangled_name_entry,
| + (count, hash_demangled_name_entry, eq_demangled_name_entry,
| free_demangled_name_entry, xcalloc, xfree));
| }
|
| /* See symtab.h */
|
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I1f074d38e1d90af58705ec852f90c84cc034cd2e
Gerrit-Change-Number: 686
Gerrit-PatchSet: 1
Gerrit-Owner: Christian Biesinger <cbiesinger@google.com>
Gerrit-Reviewer: Christian Biesinger <cbiesinger@google.com>
Gerrit-Comment-Date: Mon, 18 Nov 2019 23:24:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
next prev parent reply other threads:[~2019-11-18 23:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-18 23:14 Christian Biesinger (Code Review)
2019-11-18 23:19 ` Christian Biesinger (Code Review)
2019-11-18 23:24 ` Christian Biesinger (Code Review) [this message]
2019-11-20 4:42 ` Simon Marchi (Code Review)
2019-11-20 5:33 ` [review v2] " Christian Biesinger (Code Review)
2019-11-20 5:34 ` Christian Biesinger (Code Review)
2019-11-22 2:51 ` Kevin Buettner (Code Review)
2019-11-22 17:44 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-11-22 17:44 ` Sourceware to Gerrit sync (Code Review)
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=20191118232414.501FA2816F@gnutoolchain-gerrit.osci.io \
--to=gerrit@gnutoolchain-gerrit.osci.io \
--cc=cbiesinger@google.com \
--cc=gdb-patches@sourceware.org \
--cc=gnutoolchain-gerrit@osci.io \
/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