public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patchv2 2/2] Accelerate lookup_symbol_aux_objfile 14.5x [Re: [patch 0/2] Accelerate symbol lookups 15x]
Date: Fri, 24 Oct 2014 16:07:00 -0000	[thread overview]
Message-ID: <CAP9bCMSrz7HswXRckCvTy7tcWrNktbbYm6hXcT3GxLCZ1zNTwA@mail.gmail.com> (raw)
In-Reply-To: <20141024073308.GA20087@host2.jankratochvil.net>

On Fri, Oct 24, 2014 at 12:33 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Fri, 24 Oct 2014 09:16:01 +0200, Doug Evans wrote:
>> One thought I have is that significant changes at a higher level will
>> minimize the impact of this patch.  One change I'm thinking of making
>> is replacing iterating over every symbol table and then if that fails
>> going to the index with instead just going straight to the index: the
>> index knows where the symbols are (you mentioned this as well).
>
> Yes, I tried that first.
>
> For the performance testcase I provided the issue is in
> lookup_symbol_global_iterator_cb():
>
>   data->result = lookup_symbol_aux_objfile (objfile, GLOBAL_BLOCK,
>                                             data->name, data->domain);
>   if (data->result == NULL)
>     data->result = lookup_symbol_aux_quick (objfile, GLOBAL_BLOCK,
>                                             data->name, data->domain);
>
> Changing their order does not fix the performance as lookup_symbol_aux_quick()
> (that is quick_symbol_functions::lookup_symbol) can return NULL
>  * either if the symbol is really not present in the index.
>  * or if the symbol's symtab is already expanded.
>
> For the latter case (commonly happening) quick_symbol_functions::lookup_symbol
> finds the right symtab but then it drops that information.
>
> Changing the quick_symbol_functions::lookup_symbol semantics may fix it.

Yeah, the experiment I want to try is a bit more invasive such that,
for example, we only go to the index (and expand any symtabs found if
necessary and only search those ones). E.g., If the index returns NULL
there's no point in searching the full set of symtabs.

> But then it will get fixed only for .gdb_index files while my two patches also
> improve performance of non-.gdb_index files.

That's still an open issue, sure.

> For each objfile .gdb_index presence is orthogonal to DWZ application.
>
> Sure a question remains if we should care about performance of non-.gdb_index
> files at all.  Even for continuous edit-build-debug cycles it is worth to run
> gdb-add-index during each build.

Or have the compiler/linker build the index.

  reply	other threads:[~2014-10-24 16:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20 21:44 [patch 0/2] Accelerate symbol lookups 15x Jan Kratochvil
2014-10-22  8:55 ` Doug Evans
2014-10-23 18:24   ` [patchv2 2/2] Accelerate lookup_symbol_aux_objfile 14.5x [Re: [patch 0/2] Accelerate symbol lookups 15x] Jan Kratochvil
2014-10-24  7:16     ` Doug Evans
2014-10-24  7:33       ` Jan Kratochvil
2014-10-24 16:07         ` Doug Evans [this message]
2014-10-27  5:55           ` Doug Evans
2014-10-27  6:02             ` Doug Evans
2014-10-27  8:54             ` Jan Kratochvil
2014-11-29 12:11       ` [patchv3 2/2] Accelerate lookup_symbol_aux_objfile 85x Jan Kratochvil
2014-12-02  3:07         ` Doug Evans
2014-12-03 18:05           ` Jan Kratochvil
2014-12-04  6:21             ` Doug Evans
2014-12-04  7:27               ` [commit] " Jan Kratochvil
2014-10-22  8:57 ` [patch 0/2] Accelerate symbol lookups 15x Doug Evans
2014-10-24  7:19 ` Doug Evans

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=CAP9bCMSrz7HswXRckCvTy7tcWrNktbbYm6hXcT3GxLCZ1zNTwA@mail.gmail.com \
    --to=xdje42@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).