From: "Laurent Desnogues" <laurent.desnogues@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: Hash table based symbol lookup (was: Re: [Qemu-devel] [PATCH] Fix symbol lookup for mips64* targets)
Date: Tue, 7 Oct 2008 23:34:59 +0200 [thread overview]
Message-ID: <761ea48b0810071434y7dd3fc01n8a40174a78e1fe61@mail.gmail.com> (raw)
In-Reply-To: <761ea48b0810071234v7fb5eaf4hc3a434cb6fd2602c@mail.gmail.com>
On Tue, Oct 7, 2008 at 9:34 PM, Laurent Desnogues
<laurent.desnogues@gmail.com> wrote:
> On Tue, Oct 7, 2008 at 7:50 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
>> On 10/7/08, Laurent Desnogues <laurent.desnogues@gmail.com> wrote:
>>>
>>> This could be made less memory hungry by using some
>>> binary tree data structure at the expense of code complexity.
>>> I won't go down that road as anyway this stuff is mainly used
>>> for debugging and tracing purposes.
>>
>> I agree that hash and binary tree would be too complex.
>>
>> But what if you dropped the hash table and used a binary tree instead?
>> A binary tree would be both memory efficient (you could keep the
>> regions, maybe just use a pointer to the original symbol table) and
>> it's relatively fast. Maybe the original symbols could be sorted so
>> that the binary search could use the original table directly?
>
> I was indeed talking about replacing the whole hash table by a
> binary tree (it has been proven that mixing both is not the way
> to go; cf Knuth). The problem we have here is that we are
> doing an interval search: we are looking if an address belongs
> to a function.
>
> I will give that some thought, but don't hold your breath :-)
It suddenly occurred to me a simple binary search could be a
good solution and should be easy to implement. The resulting
complexity and memory usage should be acceptable. I will
give that a try with some huge executable.
Laurent
prev parent reply other threads:[~2008-10-07 21:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-06 10:29 Hash table based symbol lookup (was: Re: [Qemu-devel] [PATCH] Fix symbol lookup for mips64* targets) Laurent Desnogues
2008-10-06 16:11 ` Blue Swirl
2008-10-06 16:28 ` Laurent Desnogues
2008-10-07 6:48 ` Laurent Desnogues
2008-10-07 17:50 ` Blue Swirl
2008-10-07 19:34 ` Laurent Desnogues
2008-10-07 21:34 ` Laurent Desnogues [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=761ea48b0810071434y7dd3fc01n8a40174a78e1fe61@mail.gmail.com \
--to=laurent.desnogues@gmail.com \
--cc=qemu-devel@nongnu.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 NNTP newsgroup(s).