worst case symbol lookup performance

Stan Shebs shebs@cygnus.com
Tue Aug 10 11:33:00 GMT 1999

   From: jtc@redback.com (J.T. Conklin)
   Date: 10 Aug 1999 08:41:20 -0700

   It appears that write_dollar_variable() calls lookup_symbol() in order
   to expand HPUX/HPPA millicode functions ($$dyncall, etc.).  In my run,
   write_dollar_variable() called lookup_symbol() ~1000 times, which in
   turn called lookup_partial_symbol ~2,000,000 times (we have ~20,000
   symbols in our system).  But since the $ variables use in my script
   will never be found in the symbol tables, I'm encountering worst case
   behavior for each lookup.

Yow!  I'm pretty sure we shouldn't be looking for millicode functions
on anything besides HPUX native. :-)  At the very least, the bit of
code should be conditionalized to not affect anybody else.

   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?


More information about the Gdb mailing list