This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Improve symbol lookup performance noted in PR 15519
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Pedro Alves <palves at redhat dot com>, Keith Seitz <keiths at redhat dot com>, psmith at gnu dot org, gdb-patches at sourceware dot org
- Date: Mon, 3 Jun 2013 10:01:28 +0400
- Subject: Re: [patch] Improve symbol lookup performance noted in PR 15519
- References: <20903 dot 57436 dot 871210 dot 593441 at ruffy dot mtv dot corp dot google dot com> <51A86FF5 dot 9090401 at redhat dot com> <20905 dot 9501 dot 800725 dot 439795 at ruffy dot mtv dot corp dot google dot com>
> So the speedup comes from calling a more specific lookup routine for
> the task at hand.
>
> Also note that even in the "after" case we are still doing a lot of
> duplicate lookups. cp-namespace.c is a bit clumsy in some of the
> lookups it does. Although it's hampered by having to work with the
> data structures gdb provides it. My plan is to work on both this
> summer.
This is a bit of a digression, but this reminds me that we have similar
types of issues with Ada (multiple identical lookups), and it's not
easy to prevent them. The way we've dealt with the issue is to implement
a cache, and it yielded good results. I have been meaning to contribute
that code, but it needs to be cleaned up, because the cache invalidation
is performed manually by sprinkling calls to ada-lang here and there,
wherever necessary. This should be done using observers instead, adding
new ones if necessary. Perhaps the same could benefit C++ as well,
and one could even imagine a common cache or at least caching
infrastructure.
--
Joel