Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Berlin <dan@www.cgsoftware.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: <dberlin@redhat.com>, <gdb-patches@sources.redhat.com>
Subject: Re: [PATCH] Make completions almost instantaneous
Date: Fri, 30 Mar 2001 08:42:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.33.0103301134490.15336-100000@www.cgsoftware.com> (raw)
In-Reply-To: <200103301521.KAA28199@indy.delorie.com>

On Fri, 30 Mar 2001, Eli Zaretskii wrote:

> > Date: Fri, 30 Mar 2001 04:09:08 -0500 (EST)
> > From: Daniel Berlin <dberlin@redhat.com>
> >
> > All this patch does is remove code.
> >
> > Remember kids, premature optimization is the root of all evil.
>
> I tried this patch, and all I can say is WOW!  "b TAB" while debugging
> Emacs (6.6K symbols) used to take 15 seconds, now it takes 2; the same
> while debugging GDB (10K symbols) used to take 30 seconds, now it
> takes 3.

Sounds about right.  It turned completion_list_add_symbol from O(n * m)
(m is the max of the length string we are trying to add, and the string we
are  comparing it to. n is the number of things on the completion list) to
O(1). Completion list addition is called n times.

That really was murder before.
 >
> Thanks!  I was always annoyed by this, but never had time to dig into
> it.
>
I can't even count the number of gdb's i've killed off because i got tired
of waiting for completion to come up.

The best part is that it was commented as a time optimization. It's
obvious the person who added it only completely small lists. It's
absolute murder otherwise.

> > Since it's unclear to me whether this is an obvious fix, i'll wait for
> > approval from Elena or Jim.
>
> Yes, please, please, pretty please, approve this!
>


  reply	other threads:[~2001-03-30  8:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-30  1:09 Daniel Berlin
2001-03-30  7:21 ` Eli Zaretskii
2001-03-30  8:42   ` Daniel Berlin [this message]
2001-03-30 13:46 ` Elena Zannoni
2001-03-31 11:03   ` Daniel Berlin
     [not found]     ` <15047.34162.692296.724782@kwikemart.cygnus.com>
2001-04-01 13:57       ` Daniel Berlin
2001-03-30 15:50 ` Andrew Cagney
2001-03-30 20:55   ` Daniel Berlin

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=Pine.LNX.4.33.0103301134490.15336-100000@www.cgsoftware.com \
    --to=dan@www.cgsoftware.com \
    --cc=dberlin@redhat.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@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