From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Mark Wielaard <mjw@redhat.com>
Cc: Project Archer <archer@sourceware.org>
Subject: Re: gcc dwarf2out: Drop the size + performance overhead of DW_AT_sibling
Date: Wed, 19 Oct 2011 15:38:00 -0000 [thread overview]
Message-ID: <20111019153742.GA8471@host1.jankratochvil.net> (raw)
In-Reply-To: <1319016858.8669.81.camel@springer.wildebeest.org>
Hi Mark,
(.debug size)
5059640 = -3.71% no DW_AT_sibling
stap 0m0.577s (real)
gdb 0m0.234s (real)
5061160 = -3.68% DW_AT_sibling if >= 256 total children
stap 0m0.572s
gdb 0m0.232s
5084040 = -3.25%; DW_AT_sibling if >= 16 total children
stap 0m0.545s
gdb 0m0.231s
5169888 = -1.62%; DW_AT_sibling if >= 4 total children
stap 0m0.540s
gdb 0m0.235s
5254792 = ------; all DW_AT_sibling
stap 0m0.536s
gdb 0m0.243s
So the stap vs. gdb performance is exactly the opposite.
I will redo the timings after another change (DW_FORM_ref_udata) which may yet
change the timing / magic threshold.
Thanks,
Jan
gcc/
2011-10-19 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2out.c (add_sibling_attributes): New variables next_die_no and
this_die_no. Do not produce DW_AT_sibling for too few children and no
-gstruct-dwarf.
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -7490,14 +7490,21 @@ static void
add_sibling_attributes (dw_die_ref die)
{
dw_die_ref c;
+ static unsigned long next_die_no;
+ unsigned long this_die_no = next_die_no++;
if (! die->die_child)
return;
+ FOR_EACH_CHILD (die, c, add_sibling_attributes (c));
+
+ /* -gstruct-dwarf can be used for unconditional DW_AT_sibling for backward
+ compatibility. */
+ if (!dwarf_strict && next_die_no - this_die_no < 16)
+ return;
+
if (die->die_parent && die != die->die_parent->die_child)
add_AT_die_ref (die, DW_AT_sibling, die->die_sib);
-
- FOR_EACH_CHILD (die, c, add_sibling_attributes (c));
}
/* Output all location lists for the DIE and its children. */
prev parent reply other threads:[~2011-10-19 15:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201110170508.p9H581vh028090@shell.devel.redhat.com>
[not found] ` <20111017133634.GA5677@host1.jankratochvil.net>
[not found] ` <1318929963.8669.2.camel@springer.wildebeest.org>
2011-10-18 9:45 ` Jan Kratochvil
2011-10-18 9:49 ` Jan Kratochvil
2011-10-19 9:34 ` Mark Wielaard
2011-10-19 11:29 ` Jan Kratochvil
2011-10-19 15:38 ` Jan Kratochvil [this message]
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=20111019153742.GA8471@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=archer@sourceware.org \
--cc=mjw@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).