Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: David Carlton <carlton@kealia.com>
Cc: gdb@sources.redhat.com
Subject: Re: Huge slowdown since 6.0
Date: Fri, 20 Feb 2004 05:09:00 -0000	[thread overview]
Message-ID: <20040220050905.GA15209@nevyn.them.org> (raw)
In-Reply-To: <yf2vfm42hy7.fsf@hawaii.kealia.com>

On Wed, Feb 18, 2004 at 01:31:12PM -0800, David Carlton wrote:
> On Wed, 18 Feb 2004 16:09:28 -0500, Daniel Jacobowitz <drow@false.org> said:
> 
> > The only reasonable explanation is that the number of global symbols has
> > vastly increased.  This appears to be the case.  David, the blame appears to
> > be yours, in dwarf2read.c revision 1.120:
> 
> > @@ -1519,14 +1556,16 @@ add_partial_symbol (struct partial_die_i
> >           /* For C++, these implicitly act as typedefs as well. */
> >           add_psymbol_to_list (actual_name, strlen (actual_name),
> >                                VAR_DOMAIN, LOC_TYPEDEF,
> > -                              &objfile->static_psymbols,
> > +                              &objfile->global_psymbols,
> >                                0, (CORE_ADDR) 0, cu_language, objfile);
> >         }
> >        break;
> >      case DW_TAG_enumerator:
> >        add_psymbol_to_list (actual_name, strlen (actual_name),
> >                            VAR_DOMAIN, LOC_CONST,
> > -                          &objfile->static_psymbols,
> > +                          cu_language == language_cplus
> > +                          ? &objfile->static_psymbols
> > +                          : &objfile->global_psymbols,
> >                            0, (CORE_ADDR) 0, cu_language, objfile);
> >        break;
> >      default:
> 
> > Could you re-explain the need for this change, please?  You said:
> 
> > +           /* NOTE: carlton/2003-11-10: C++ class symbols shouldn't
> > +              really ever be static objects: otherwise, if you try
> > +              to, say, break of a class's method and you're in a file
> > +              which doesn't mention that class, it won't work unless
> > +              the check for all static symbols in lookup_symbol_aux
> > +              saves you.  See the OtherFileClass tests in
> > +              gdb.c++/namespace.exp.  */
> > +
> 
> > but is that also necessary for enumerators?  As things stand, one
> > large enum in a used header can lead to worse-than-linear slowdown
> > of GDB startup for DWARF-2, and a couple megabytes of wasted memory.
> 
> Crap.  Well, in some sense, enumerators really are global in C++: it's
> illegal to have two different enums in the same scope that have an
> enumerator with the same name.  (I'm pretty sure.)  So, in the
> mythical future super-groovy-GDB where we coalesce all sorts of
> type-related debug information across files, it would be nice if, in
> the C++ case, enumerators were treated as global (and were coalesced).
> 
> Having said that, it should be the case that handling enumerators this
> way is much less important than handling class symbols this way.  I
> can't quite envision the consequences of reverting the change for
> enumerators; it will mean that you can't print out enumerators that
> are defined in namespaces and that aren't in the debug info for the
> current source file (if any), but that doesn't sound like too big a
> deal to me.

OK, boot to the head time.

My testcase is in C.

These are all conditionalized on language_cplus.

How can they possibly be to blame?  Well, they are.  And reverting the
change for enumerators definitely won't do any harm.  Take a look at
this, read it two or three times if necessary - it took me about a
dozen:

> > -                          &objfile->static_psymbols,
> > +                          cu_language == language_cplus
> > +                          ? &objfile->static_psymbols
> > +                          : &objfile->global_psymbols,

If I swap "static" and "global", it reduces GDB startup time by roughly
40% for glibc with debug information, which contains a lot of C
enumerators.  I assume that is what you meant to do in the first place?
If so I can recover the speed hit for C for GDB 6.1, and then address
the larger issues with large numbers of global psymbols in HEAD after
we branch.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  parent reply	other threads:[~2004-02-20  5:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-18 21:09 Daniel Jacobowitz
2004-02-18 21:31 ` David Carlton
2004-02-18 22:45   ` Kip Macy
2004-02-19  3:35     ` Daniel Jacobowitz
2004-02-19  5:06       ` Kip Macy
2004-02-19 15:40         ` Daniel Jacobowitz
2004-02-20  5:09   ` Daniel Jacobowitz [this message]
2004-02-20 16:42     ` Elena Zannoni
2004-02-20 16:47       ` Daniel Jacobowitz
2004-02-20 17:33         ` Elena Zannoni
2004-02-20 17:01       ` Andrew Cagney
2004-02-20 17:05         ` Daniel Jacobowitz
2004-02-20 17:45         ` Elena Zannoni
2004-02-20 18:07           ` Andrew Cagney
2004-02-20 18:24             ` Daniel Jacobowitz
2004-02-20 18:45               ` Andrew Cagney
2004-02-20 18:48                 ` Daniel Jacobowitz
2004-02-21  9:21                   ` Eli Zaretskii
2004-02-21  9:04                 ` Eli Zaretskii
2004-02-21  2:18           ` Daniel Jacobowitz
2004-02-20 16:52     ` David Carlton
2004-02-20 16:58       ` Daniel Jacobowitz
2004-02-20 17:00         ` David Carlton
2004-02-20 17:35       ` Elena Zannoni
2004-02-19  1:59 ` Elena Zannoni
2004-02-19  3:35   ` Daniel Jacobowitz
2004-02-19  3:58     ` Daniel Jacobowitz
2004-02-20 19:57 Michael Elizabeth Chastain
2004-02-23 19:22 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040220050905.GA15209@nevyn.them.org \
    --to=drow@false.org \
    --cc=carlton@kealia.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox