Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>,  Doug Evans <dje@google.com>
Subject: Re: [RFA/PATCH] PR/9711: quadratic slowdown for deep stack traces
Date: Mon, 07 Sep 2009 22:21:00 -0000	[thread overview]
Message-ID: <200909072321.12505.pedro@codesourcery.com> (raw)
In-Reply-To: <20090907220012.GK30677@adacore.com>

On Monday 07 September 2009 23:00:12, Joel Brobecker wrote:
> > Hmmm, nowhere in the patch is the actual reason this is
> > needed explained.  Could you have some of that?
> 
> Good idea, Pedro. How's the attached?
> 
> +  /* Try using the frame stash first.  Finding it there removes the need
> +     to perform the search by looping over all frames, which can be very
> +     CPU-intensive if the number of frames is very high (the loop is O(n)
> +     and get_prev_frame performs a series of checks that are relatively
> +     expensive).  This optimization is particularly useful when this function
> +     is called from another function which already loops over all frames,
> +     making the overall behavior O(n^2).  */

Fine with me, although I wouldn't mind a reference to which is the
the "another function" talked about here (--- my thinking is that it
should be "easy" to get here when touching the problematic caller in
question.  If it is grep-easy, the merrier.  If the reference in the
comment ends up out-of-date at some point, then it just means the
that a good time to rethink the stash as been
reached).   Just a "(see foo_func)" would be fine.  Anyway, thanks!

-- 
Pedro Alves


  reply	other threads:[~2009-09-07 22:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03 18:37 Joel Brobecker
2009-09-03 20:27 ` Tom Tromey
2009-09-07  7:30 ` Doug Evans
2009-09-07 20:33   ` Joel Brobecker
2009-09-07 20:48     ` Doug Evans
2009-09-07 20:57     ` Pedro Alves
2009-09-07 22:00       ` Joel Brobecker
2009-09-07 22:21         ` Pedro Alves [this message]
2009-09-07 23:12           ` Joel Brobecker
2009-09-08  0:06             ` Joel Brobecker
2009-09-09 17:39               ` Joel Brobecker

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=200909072321.12505.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /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