From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7035 invoked by alias); 19 Oct 2011 09:34:46 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 6690 invoked by uid 22791); 19 Oct 2011 09:34:45 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Subject: Re: gcc dwarf2out: Drop the size + performance overhead of DW_AT_sibling From: Mark Wielaard To: Jan Kratochvil Cc: Project Archer In-Reply-To: <20111018094457.GB2412@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> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 19 Oct 2011 09:34:00 -0000 Message-ID: <1319016858.8669.81.camel@springer.wildebeest.org> Mime-Version: 1.0 X-SW-Source: 2011-q4/txt/msg00002.txt.bz2 Hi Jan, On Tue, 2011-10-18 at 11:44 +0200, Jan Kratochvil wrote: > On Tue, 18 Oct 2011 11:26:03 +0200, Mark Wielaard wrote: > > On Mon, 2011-10-17 at 15:36 +0200, Jan Kratochvil wrote: > > > gcc.post: Drop DW_AT_sibling; remove 27 LoC: -3.49% .debug size, -1.7% > > > GDB time. > >=20 > > Do you have more information about that? Systemtap for example, which > > uses elfutils libdw uses DW_AT_subling to more efficiently go through > > the debug_info DIEs. >=20 > The patch with various benchmarks is: > [patch] dwarf2out: Drop the size + performance overhead of DW_AT_sibling > http://gcc.gnu.org/ml/gcc-patches/2011-10/msg00992.html >=20 > GDB also uses DW_AT_sibling when available (skip_one_die and > locate_pdi_sibling). The mail above quotation: > # I guess DW_AT_sibling had real performance gains on CPUs with 1x (=3Dno= ) clock > # multipliers. Nowadays mostly only the data size transferred over FSB m= atters. >=20 > The problem is the DIEs skipping by CPU is so cheap on current CPUs it ca= nnot > be compared with the overhead of providing the helper data for it. I did= not > expect dropping DW_AT_sibling would be even a consumer performance > _improvement_. I expected more it will be either not measurable or just = not > significant enough for the .debug on-disk sizes cost justification. >=20 > I did only gdb and idb benchmarks. systemtap benchmark is welcome, libst= dc++ > files for benchmark, if it is enough for systemtap this way: > http://people.redhat.com/jkratoch/ns.tar.xz Thanks for those. Some quick benchmarks show systemtap selection of functions and function parameters is slightly slower without DW_AT_sibling being available. But not dramatically. $ for i in $(find ns -name libstdc++.so.6.0.17.debug); do echo $i; time stap -l "process(\"$i\").function(\"*\")" | wc --lines; done ns/gccgit-c-xxxxxxxxxxxxx-test/default/libstdc++.so.6.0.17.debug 1852 real 0m0.427s user 0m0.392s sys 0m0.036s ns/gccgit-c-xxxxxxxxxxxxx-test/gdbindex/libstdc++.so.6.0.17.debug 1852 real 0m0.422s user 0m0.384s sys 0m0.035s ns/gccgit-c-ns-xxxxxxxxxx-test/default/libstdc++.so.6.0.17.debug 1852 real 0m0.447s user 0m0.406s sys 0m0.042s ns/gccgit-c-ns-xxxxxxxxxx-test/gdbindex/libstdc++.so.6.0.17.debug 1852 real 0m0.443s user 0m0.404s sys 0m0.037s That is selecting all functions in libstdc++. Systemtap doesn't use gdbindex, but I included it so you can see the "noise". Here the slowdown seems somewhat equal to the noise. If we also want parameters/variables listed for each function probe point (using -L) things are a bit more visible: $ for i in $(find ns -name libstdc++.so.6.0.17.debug); do echo $i; time stap -L "process(\"$i\").function(\"*\")" | wc --lines; done ns/gccgit-c-xxxxxxxxxxxxx-test/default/libstdc++.so.6.0.17.debug 1852 real 0m0.573s user 0m0.522s sys 0m0.043s ns/gccgit-c-xxxxxxxxxxxxx-test/gdbindex/libstdc++.so.6.0.17.debug 1852 real 0m0.558s user 0m0.505s sys 0m0.052s ns/gccgit-c-ns-xxxxxxxxxx-test/default/libstdc++.so.6.0.17.debug 1852 real 0m0.611s user 0m0.556s sys 0m0.056s ns/gccgit-c-ns-xxxxxxxxxx-test/gdbindex/libstdc++.so.6.0.17.debug 1852 real 0m0.603s user 0m0.557s sys 0m0.045s Still no dramatic slowdown, but probably enough to discount random noise in the measurements. So DW_AT_sibling definitely does help systemtap/libdw walk a little bit more efficient through the DIE tree. But you are right that walking the DIE tree even without them can be done pretty quickly. Cheers, Mark