Re: [patch] Improve symbol lookup performance noted in PR 15519

Joel Brobecker
2013-06-03T06:01:43Z

> 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