From: Daniel Jacobowitz <drow@false.org>
To: Jim Blandy <jimb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa/dwarf] Support for attributes pointing to a different CU
Date: Tue, 05 Oct 2004 13:48:00 -0000 [thread overview]
Message-ID: <20041005134808.GA11252@nevyn.them.org> (raw)
In-Reply-To: <vt23c0t3gdh.fsf@zenia.home>
On Tue, Oct 05, 2004 at 12:04:26AM -0500, Jim Blandy wrote:
> The only advantage I had in mind was simplicity, and it didn't seem
> like it'd be a performance hit.
>
> The libiberty hash table expands by a given ratio each time, which
> means that, overall, the number of rehashings per element is constant
> no matter how large the table gets. It's similar to the analysis that
> shows that ye olde buffer doubling trick ends up being linear time.
> (I'm thinking on my own here, not quoting anyone, so be critical...)
>
> There could be a locality disadvantage to doing it all in one big hash
> table. When the time comes to restore a given CU's types, their table
> entries will be sharing cache blocks with those of other, irrelevant
> CU's. That doesn't happen if we use for per-CU hash tables: table
> entries will never share cache blocks with table entries for other
> CU's (assuming the tail of one table doesn't share a block with the
> head of another, blah blah blah...).
>
> I'm concerned about the legacy of complexity we'll leave. Wrinkles
> should prove they can pay their own way. :)
Then there's only one thing to do... I'll time it.
Using a per-objfile type_hash saves a little memory in overhead, and
probably a little more in hash table size - I didn't instrument memory
use. But it's definitely slower. From 1% to 4.3% depending on the
test case.
I believe this happens because we can create the per-comp-unit hash
tables at the correct size - I use a heuristic based on the size of the
CU, although by this point I could use a more accurate one based on the
number of DIEs if I thought it would be worthwhile. If we create a
per-objfile CU, then we don't get this benefit, so we do a lot of
copying. There's also the locality benefit.
Also, it saves no code - unless you see something I'm missing, it was
basically s/cu->per_cu->type_hash/dwarf2_per_objfile->type_hash/. So,
OK with the per-comp-unit hash?
--
Daniel Jacobowitz
next prev parent reply other threads:[~2004-10-05 13:48 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-23 4:57 Daniel Jacobowitz
2004-09-23 22:19 ` Jim Blandy
2004-09-23 22:33 ` Daniel Jacobowitz
2004-09-24 0:34 ` Daniel Jacobowitz
2004-09-28 22:43 ` Jim Blandy
2004-09-28 22:51 ` Jim Blandy
2004-09-28 22:57 ` Jim Blandy
2004-10-04 0:41 ` Daniel Jacobowitz
2004-10-04 22:12 ` Jim Blandy
2004-10-04 23:35 ` Daniel Jacobowitz
2004-10-05 5:13 ` Jim Blandy
2004-09-28 23:07 ` Jim Blandy
2004-10-03 16:28 ` Daniel Jacobowitz
2004-09-29 17:52 ` Jim Blandy
2004-10-03 16:12 ` Daniel Jacobowitz
2004-10-04 21:17 ` Jim Blandy
2004-10-04 21:22 ` Daniel Jacobowitz
2004-10-05 5:07 ` Jim Blandy
2004-10-05 13:48 ` Daniel Jacobowitz [this message]
2004-10-05 16:13 ` Jim Blandy
2004-10-05 16:11 ` Jim Blandy
2004-10-05 18:01 ` Daniel Jacobowitz
2004-10-05 19:24 ` Jim Blandy
2004-09-29 17:54 ` Jim Blandy
2004-09-29 19:53 ` Jim Blandy
2004-10-03 16:16 ` Daniel Jacobowitz
2004-09-29 20:19 ` Jim Blandy
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=20041005134808.GA11252@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@redhat.com \
/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