public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "l.lunak at suse dot cz" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/13498] save-index makes gdb slow with dwarf4
Date: Mon, 20 Feb 2012 13:51:00 -0000	[thread overview]
Message-ID: <bug-13498-4717-X03UgpavLF@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-13498-4717@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=13498

--- Comment #5 from Luboš Luňák <l.lunak at suse dot cz> 2012-02-20 13:48:42 UTC ---
I'd like to point out again the second paragraph in comment #2. It's been a
while since I did this analysis, so I don't remember all the details anymore
and getting into it again would take some time, therefore this is a bit of
guesswork and trying to recall, but as far as I remember:

I think I concluded that this is not a localized problem in
dw2_map_symbol_filenames(), but a design problem with the gdb internal
structures. I had a patch for dw2_map_symbol_filenames() that would have worked
sufficiently for me for that one specific problem, but I went back to dwarf-2
anyway, and IIRC I decided that larger changes were needed that I wasn't
feeling up to.

Specifically, I think I found the bottleneck to be
dwarf2_per_objfile->n_type_units being a large number in general that slows
down more operations than just the one specific example given. As I understand
it dwarf-2 had this number quite low, so it wasn't a problem, but dwarf-4 by
design causes the number to be much higher.

Again, this is just trying to recall things from 2 months ago with my limited
gdb knowledge, so you should verify this yourself, but I suggest first checking
gdb's performance in general when dealing with large dwarf-4-built .so files.
Maybe it'll be necessary to change all accesses to the CU-list (or whatever
it's called exactly) to be more efficient (compact it into less items,
hashtable for access, whatever).

Also, for the save-index case, since gdb creates the index on its own anyway,
it could possibly make sense to prepare it better for the completion case. As I
understand it, gdb always first collects all items for completion and only
afterwards it selects ones eligible for completion, so maybe the index could
also contain a sorted list of (references to) all completion items in the
matching .so, which presumably would take only relatively little space and
would make completion almost instant.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  parent reply	other threads:[~2012-02-20 13:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 17:21 [Bug gdb/13498] New: " l.lunak at suse dot cz
2011-12-14 23:28 ` [Bug gdb/13498] " l.lunak at suse dot cz
2011-12-15 15:55 ` l.lunak at suse dot cz
2012-02-15 12:12 ` lionel at mamane dot lu
2012-02-16 11:00 ` mjw at redhat dot com
2012-02-17 21:48 ` tromey at redhat dot com
2012-02-17 21:52 ` tromey at redhat dot com
2012-02-20 13:51 ` l.lunak at suse dot cz [this message]
2012-02-20 19:51 ` tromey at redhat dot com
2012-02-20 19:55 ` tromey at redhat dot com
2012-02-20 20:57 ` cvs-commit at gcc dot gnu.org
2012-02-21  6:32 ` dje at google dot com
2012-02-21 18:17 ` l.lunak at suse dot cz
2012-07-08 19:35 ` dje at google dot com
2012-07-10 20:29 ` cvs-commit at gcc dot gnu.org
2023-12-31 13:08 ` ssbssa at sourceware dot org
2023-12-31 16:42 ` tromey at sourceware dot org

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=bug-13498-4717-X03UgpavLF@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).