Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb.
Date: Sat, 14 Jul 2012 00:07:00 -0000	[thread overview]
Message-ID: <CADPb22T39LYnXaPQTvJH0aJFkKXCevHgUyhJPQ7=Okq4KkouTg@mail.gmail.com> (raw)
In-Reply-To: <CADPb22Q=qT4AHoOo8cT1joKFziZqkzNFFTTP76_WDarV6mS+zg@mail.gmail.com>

On Fri, Jul 13, 2012 at 11:52 AM, Doug Evans <dje@google.com> wrote:
> Hi.  "ping" [for the libiberty part]
>
> [The gdb part needs to be updated due to recent changes there, but I'm
> going to wait until the libiberty part is approved.]
>
> On Mon, Jul 9, 2012 at 11:10 AM, Doug Evans <dje@google.com> wrote:
>> Hi.
>>
>> filename_seen in gdb does a linear search, this patch changes it
>> to use a hash table.
>>
>> Ok to check in?
>>
>> I couldn't think of a good reason to put filename_hash,filename_eq in gdb,
>> and I like placing them close to where hashtab.c and filename_cmp are defined.
>> I also couldn't think of a sufficient reason to put them in a file by
>> themselves.  Ergo adding them to filename_cmp.c, filenames.h.
>> [It's possible there's a program that uses filename_cmp and already
>> defines functions with the same names (thus this will introduce a build
>> failure), but that's always a risk.  I couldn't find any in gdb,binutils,gcc.
>> Technically speaking, it's also possible that adding the #include "hashtab.h"
>> to filenames.h could introduce a build failure (e.g., some file has a static
>> symbol that collides with one used in hashtab.h).  I'm hoping that's more of
>> a theoretical concern.]
>>
>> 2012-07-09  Doug Evans  <dje@google.com>
>>
>>         include/
>>         * filenames.h: #include "hashtab.h".
>>         (filename_hash, filename_eq): Declare.
>>
>>         libiberty/
>>         * filename_cmp.c (filename_hash, filename_eq): New functions.
>>
>>         gdb/
>>         * symtab.c (filename_seen): Rewrite to use a hash table.

With the libiberty part done, here's the updated gdb side.

As data, using my standard large app for exercising gdb issues, and
after running it a few times to warm the disk cache (for the fullname
conversion):

gdb $program # uses .gdb_index v7
(gdb) mt time 1
(gdb) info sources #1
(gdb) info sources #2

Before (best of 3):
#1: 18.100000 (cpu), 18.666510 (wall)
#2: 7.580000 (cpu), 7.936617 (wall)

After (best of 3):
#1: 10.060000 (cpu), 10.912673 (wall)
#2: 0.280000 (cpu), 2.746012 (wall)

Ok to check in?

2012-07-13  Doug Evans  <dje@google.com>

        * symtab.c (filename_seen_cache): Delete members "tab_alloc_size",
        "tab_cur_size".  Change member "tab" to be a htab_t.
        (create_filename_seen_cache): Update.
        (clear_filename_seen_cache, delete_filename_seen_cache): Update.
        (filename_seen): Update.


  parent reply	other threads:[~2012-07-14  0:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120709181015.2FCA41E13A1@ruffy2.mtv.corp.google.com>
     [not found] ` <CABu31nPhJ_3+yCNCArF7P3+Z+13cXVSoTqUyn1rKKQXv4+oVUA@mail.gmail.com>
2012-07-09 19:49   ` Doug Evans
2012-07-13 18:52 ` Doug Evans
2012-07-13 19:22   ` DJ Delorie
2012-07-13 19:37     ` Doug Evans
2012-07-13 19:46       ` DJ Delorie
2012-07-13 19:48       ` Eli Zaretskii
2012-07-13 21:26         ` Doug Evans
2012-07-14  6:34           ` Eli Zaretskii
     [not found]           ` <831ukeam18.fsf__35820.0409253643$1342247693$gmane$org@gnu.org>
2012-07-15  2:18             ` Tom Tromey
2012-07-14  0:07   ` Doug Evans [this message]
2012-07-14  1:59     ` Tom Tromey
2012-07-09 18:14 Doug Evans
2012-07-10 19:17 ` Tom Tromey

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='CADPb22T39LYnXaPQTvJH0aJFkKXCevHgUyhJPQ7=Okq4KkouTg@mail.gmail.com' \
    --to=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