From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22115 invoked by alias); 5 Oct 2006 15:37:16 -0000 Received: (qmail 22105 invoked by uid 22791); 5 Oct 2006 15:37:15 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 05 Oct 2006 15:37:12 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GVVHU-0000Yl-FI; Thu, 05 Oct 2006 11:37:04 -0400 Date: Thu, 05 Oct 2006 15:37:00 -0000 From: Daniel Jacobowitz To: Jean-Marc Saffroy Cc: Frederic RISS , gdb@sourceware.org Subject: Re: gdb script performance Message-ID: <20061005153704.GA1864@nevyn.them.org> Mail-Followup-To: Jean-Marc Saffroy , Frederic RISS , gdb@sourceware.org References: <1160053117.13420.17.camel@crx549.cro.st.com> <20061005133228.GA30276@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00027.txt.bz2 On Thu, Oct 05, 2006 at 05:29:30PM +0200, Jean-Marc Saffroy wrote: > On Thu, 5 Oct 2006, Daniel Jacobowitz wrote: > > >If you would like to see if further improvement is possible, you should > >build a GDB with profiling enabled (--enable-profiling at configure > >time), and use the maint set profile command to get a profile; then > >post exact data from it. > > Please find attached gprof output (this is with gdb 6.5 + > gdb-lookup-internal-first-3.patch running the lsmaps script I posted > earlier). > > Thanks for helping! 26.14 381.31 381.31 141867 2.69 3.50 find_pc_sect_psymtab 18.54 651.82 270.51 331876 0.82 0.82 find_pc_sect_section 17.88 912.69 260.87 144847060 0.00 0.00 lookup_partial_symbol 11.01 1073.33 160.64 1254595136 0.00 0.00 strcmp_iw 4.98 1145.97 72.64 34010 2.14 16.50 lookup_symbol_aux_psymtabs 4.78 1215.73 69.75 9584 7.28 8.12 fixup_section 4.46 1280.79 65.06 lbasename 3.42 1330.64 49.85 12183 4.09 4.09 lookup_partial_symtab 1.83 1357.34 26.70 33844664 0.00 0.00 strcmp_iw_ordered 1.68 1381.82 24.48 1288426966 0.00 0.00 symbol_natural_name 1.09 1397.71 15.89 1288426966 0.00 0.00 symbol_search_name Well then. Observations: - We're looking up partial symbols way too often. - It's taking way too long. - And oh my lord is that a lot of calls to the (fairly inefficient) strcmp_iw. It looks like only about three calls to find_pc_sect_psymtab per expression evaluation, which is bad but not too bad - sounds like a last-searched-item cache may be useful. (To be clear: I don't have time to work on this just now.) -- Daniel Jacobowitz CodeSourcery