This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: gcc dwarf2out: Drop the size + performance overhead ofDW_AT_sibling
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: Project Archer <archer at sourceware dot org>
- Date: Wed, 19 Oct 2011 17:37:42 +0200
- Subject: Re: gcc dwarf2out: Drop the size + performance overhead ofDW_AT_sibling
- References: <201110170508.p9H581vh028090@shell.devel.redhat.com><20111017133634.GA5677@host1.jankratochvil.net><1318929963.8669.2.camel@springer.wildebeest.org><20111018094457.GB2412@host1.jankratochvil.net><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. */