From: Daniel Jacobowitz <dan@codesourcery.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] symtab/11942: rewrite dwarf2read.c type_hash usage
Date: Thu, 09 Sep 2010 19:55:00 -0000 [thread overview]
Message-ID: <20100909161546.GB19645@caradoc.them.org> (raw)
In-Reply-To: <20100824000327.7787684B8E@ruffy.mtv.corp.google.com>
On Mon, Aug 23, 2010 at 05:03:27PM -0700, Doug Evans wrote:
> The basic idea here is that instead of having one type_hash per CU,
> we have one type_hash for dies from .debug_info and have another type_hash
> for dies from .debug_types. Types are hashed based on the associated
> die's offset and are not freed when a CUs dwarf2_cu structure is freed,
> thus I can't see a need for one type_hash per CU.
FWIW, I believe I chose this way for performance. If we have the DIE,
we have the CU, and this keeps the hash tables smaller and makes it
easier to estimate their size. Sure, lookups are O(1), but there's
also both cache behavior and the cost of resizing during read-in to
consider. I did a whole lot of benchmarking, and the
"cu->header.length / 24" worked out well.
Things have changed since then, though, not least Tom's index support.
> Plus, when looking up a type for a given die, gdb first reads in the
> die at the given offset and then looks up the type for the die at that
> offset. Since we hash types based on die offsets, I can't see a reason
> why we don't just lookup the type for the die at the given offset first,
> and only if that fails read in the die (this is useful, e.g., when
> dies have been flushed because the CU has reached max-cache-age).
This part makes total sense. Duh!
--
Daniel Jacobowitz
CodeSourcery
prev parent reply other threads:[~2010-09-09 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-24 0:03 Doug Evans
2010-08-24 8:30 ` Doug Evans
2010-08-24 21:14 ` Tom Tromey
2010-09-09 19:55 ` Daniel Jacobowitz [this message]
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=20100909161546.GB19645@caradoc.them.org \
--to=dan@codesourcery.com \
--cc=dje@google.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