From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 892 invoked by alias); 19 Oct 2011 15:38:09 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 882 invoked by uid 22791); 19 Oct 2011 15:38:08 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Date: Wed, 19 Oct 2011 15:38:00 -0000 From: Jan Kratochvil To: Mark Wielaard Cc: Project Archer Subject: Re: gcc dwarf2out: Drop the size + performance overhead of DW_AT_sibling Message-ID: <20111019153742.GA8471@host1.jankratochvil.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1319016858.8669.81.camel@springer.wildebeest.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2011-q4/txt/msg00004.txt.bz2 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 * 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. */