Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jason Molenda <jason-swarelist@molenda.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] bug in symtab.c:lookup_block_symbol()'s search method
Date: Sat, 15 Sep 2001 13:08:00 -0000	[thread overview]
Message-ID: <20010915130802.A12003@shell17.ba.best.com> (raw)
In-Reply-To: <87ofocpks1.fsf@cgsoftware.com>

On Sat, Sep 15, 2001 at 10:54:06AM -0400, Daniel Berlin wrote:

> Note that combining the solutions I later attempted avoids the problem
> of having 
> to show that all the languages gdb supports can't do symbol lookups
> on something that starts with a character strcmp_iw ignores,
> altogether.

I guess you didn't read either of my initial notes in this discusssion.
I provided pointers to them in the patch submission.  

> This would be using a hash table for the block array, which we already
> have a hash function ideal for (minsym_hash_iw or whatever it's
> called), and the not actually searching blocks that don't contain the
> symbol.
> 
> This would give you O(1) symbol lookup time, effectively (A given
> symbol only searches a constant number of blocks).
> This would certainly make your debugger much faster to respond.


What you're proposing is to ignore the inefficiencies of
lookup_block_symbol by reducing the number of calls to it.  Instead,
why don't we fix the inefficiencies in lookup_block_symbol *and*
reduce the number of calls to it?  Imagine how the gdb users will
be dancing in the street, thanking buddha for their great fortune of
having such a wonderful debugger.

Concretely.  GDB has a number of symtabs, call it 'i', and a number of
_unique_ global blocks, call it 'j'.  Every symtab has a link to a global
block, but few of these global blocks are unique.  In gdb itself, i is
an order of magnitude larger than j.  I expect some programs will have
i two orders of magnitude larger than j.  Each global block has a number
of symbols in it, call the average of these 'n'.

In gdb 5.0, looking for an undefined symbol will happen on order of 
O(i * lg (n)).  In gdb 5.1, that search will be on the order of 
O(i * 1/2 * n).  Dan's proposal is to change this to O(j * 1/2 * n).  
I am looking for at _least_ O(i * lg (n)), but I'd really like to see 
us get both of these eventually for O(j * lg (n)).

If we define conservatively as i = j * 10, these become

 gdb 5.0                   O (j * 10 * lg (n))
 gdb 5.1                   O (j * 10 * 1/2 * n)
 My patch                  O (j * 10 * lg (n))

 What I'd like to see      O (j * lg (n))
 Dan's block patch alone   O (j * 1/2 * n))

Debugging gdb itself, "i" is 330, and "j" is 23.  The average number
of symbols was small - I don't have the number here right now, but
I think it was around 10 symbols.  All of these numbers are a lot
larger for a C++ program, obviously.

Jason


  reply	other threads:[~2001-09-15 13:08 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-09  7:48 Jason Molenda
2001-09-10 11:24 ` Michael Snyder
2001-09-10 11:32   ` Jason Molenda
2001-09-10 11:50     ` Daniel Berlin
2001-09-10 11:52       ` Daniel Berlin
     [not found]       ` <20010910130347.A5628@shell17.ba.best.com>
2001-09-10 14:17         ` Daniel Berlin
2001-09-14  7:53           ` Andrew Cagney
2001-09-14  8:53             ` Daniel Berlin
2001-09-14  9:06             ` Eli Zaretskii
2001-09-14  9:13               ` Jason Molenda
2001-09-14  9:58                 ` Daniel Berlin
2001-09-14 10:55                   ` Eli Zaretskii
2001-09-14 10:52                 ` Eli Zaretskii
2001-09-14 10:59                   ` Daniel Jacobowitz
2001-09-14 11:57                     ` Eli Zaretskii
2001-09-15  0:54                   ` Jason Molenda
2001-09-15  3:43                     ` Eli Zaretskii
2001-09-15  8:01                       ` Daniel Berlin
2001-09-15  9:09                         ` Eli Zaretskii
2001-09-15 12:36                         ` Daniel Jacobowitz
2001-09-15 12:52                       ` Jason Molenda
2001-09-15  7:54                     ` Daniel Berlin
2001-09-15 13:08                       ` Jason Molenda [this message]
2001-09-15 13:33                         ` Daniel Berlin
2001-09-15 13:52                           ` Daniel Berlin
2001-09-15 14:02                             ` Jason Molenda
2001-09-15 14:21                               ` Daniel Berlin
2001-09-16  0:15                               ` Eli Zaretskii
2001-09-17 22:56                                 ` Andrew Cagney
2001-09-17 23:12                                   ` Jason Molenda
2001-09-18  6:21                                     ` Daniel Berlin
2001-09-18  7:32                                     ` Andrew Cagney
2001-09-17 23:18                                   ` Daniel Jacobowitz
2001-09-18  4:51                                     ` Eli Zaretskii

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=20010915130802.A12003@shell17.ba.best.com \
    --to=jason-swarelist@molenda.com \
    --cc=gdb-patches@sources.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