This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patchv2 2/2] Accelerate lookup_symbol_aux_objfile 14.5x [Re: [patch 0/2] Accelerate symbol lookups 15x]
- From: Doug Evans <xdje42 at gmail dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 24 Oct 2014 09:07:30 -0700
- Subject: Re: [patchv2 2/2] Accelerate lookup_symbol_aux_objfile 14.5x [Re: [patch 0/2] Accelerate symbol lookups 15x]
- Authentication-results: sourceware.org; auth=none
- References: <20141020214410 dot GA22011 at host2 dot jankratochvil dot net> <CAP9bCMQ7EXyXJiqK4j2UA9YgxkQiNFFqJPOpbPXH8-YZMRLh2w at mail dot gmail dot com> <20141023182434 dot GA31412 at host2 dot jankratochvil dot net> <CAP9bCMTrzU7srWLfiS2814nfBEySJ-i6yKy7AKHBvXbUoLa-rQ at mail dot gmail dot com> <20141024073308 dot GA20087 at host2 dot jankratochvil dot 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.