This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: worst case symbol lookup performance
- To: Stan Shebs <shebs@cygnus.com>
- Subject: Re: worst case symbol lookup performance
- From: Srikanth <srikanth@cup.hp.com>
- Date: Tue, 10 Aug 1999 12:20:08 -0700
- CC: jtc@redback.com, gdb@sourceware.cygnus.com
- Organization: California Language Lab
- References: <199908101833.LAA21916@andros.cygnus.com>
Stan Shebs wrote:
>
> From: jtc@redback.com (J.T. Conklin)
> Date: 10 Aug 1999 08:41:20 -0700
>
> I'm not familiar with the symbol handling portions of GDB, so I'm
> looking for ideas. Removing the symbol lookups from write_dollar_-
> variable() significantly improves performance, but doesn't solve the
> underlying problem.
>
> Presumably you get a ~8 times speedup by removing the symbol lookup.
> What does profiling say is the most expensive operation now?
> Srikanth, did you ever look at this issue?
>
> Stan
No. This has not shown up in our profiles so far. As for
symbol lookup performance, we have successfully prototyped a new
scheme, whereby lookups are a lot faster.
Minimal symbol table :
Currently the minimal symbol table is sorted by address only.
In our prototype, we also sort it by the mangled name. So name lookups
are also in logarithmic time. To allow searching the minimal symbol
table by unmangled C++ names, we have come up with a just-in-time
mangling/demangling scheme. According to this, at startup gdb will
not demangle minimal symbol table entries. Instead when a lookup
happens, we will mangle the signature just enough to get a
reasonably long prefix of the mangled name, use the prefix to
binary search the table and demangle symbols with the same prefix
and do a full compare.
Partial symbol table :
All our partial symbol tables will be empty. We will use
the minimal symbol table to lookup the symbol, use the address
found there to decide which psymtab to expand. This works in
part because in HP-gdb, the psymtabs contain only the procedure
psymbols. No types, variables etc ... There is one special "globals"
psymtab which contains all variables and types.
Srikanth