From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15363 invoked by alias); 9 Mar 2004 16:58:44 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15324 invoked from network); 9 Mar 2004 16:58:42 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 9 Mar 2004 16:58:42 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1B0kYz-0004Me-Ms for ; Tue, 09 Mar 2004 11:58:41 -0500 Date: Fri, 19 Mar 2004 00:09:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [RFA/dwarf] Allocate abbrevs from a new obstack Message-ID: <20040309165841.GE27765@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20040225035543.GA13672@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.1i X-SW-Source: 2004-03/txt/msg00202.txt.bz2 On Thu, Feb 26, 2004 at 05:09:36PM -0500, Jim Blandy wrote: > > Daniel Jacobowitz writes: > > Another independent performance optimization from my profiling. This one is > > good for several percent speedup on mainline. My original description: > > > > - It plugs a huge memory leak. After loading partial symbols for > > libc, GDB uses 5.6MB memory without this patch and 1.6MB with it. > > We weren't emptying the abbrev table. > > > > [Specifically, we were emptying it after dwarf2_build_psymtabs_hard, > > instead of once each time through the loop. dwarf2_read_abbrevs then > > zeroed out the allocated, unreferenced pointers.] > > > > - I spent a lot of time trying to find alternate data structures that > > would be more efficient. The expandable hash table is slower, even if > > you initially allocate it to the right size. The splay tree I expected > > to be quite good in this case, but it isn't either; the overhead is simply > > too high. The fixed-size ad-hoc hash table appears to be the best we can > > do. > > > > Tested on i686-pc-linux-gnu, no regressions. OK to commit? > > Looks great --- please do. OK, I've retested this and checked it in. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15363 invoked by alias); 9 Mar 2004 16:58:44 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15324 invoked from network); 9 Mar 2004 16:58:42 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 9 Mar 2004 16:58:42 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1B0kYz-0004Me-Ms for ; Tue, 09 Mar 2004 11:58:41 -0500 Date: Tue, 09 Mar 2004 16:58:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [RFA/dwarf] Allocate abbrevs from a new obstack Message-ID: <20040309165841.GE27765@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20040225035543.GA13672@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.1i X-SW-Source: 2004-03.o/txt/msg00202.txt Message-ID: <20040309165800.rwpkztU6LjzWvJysr0BMdJD7WfrqN1RCx2g2MTZFtNA@z> On Thu, Feb 26, 2004 at 05:09:36PM -0500, Jim Blandy wrote: > > Daniel Jacobowitz writes: > > Another independent performance optimization from my profiling. This one is > > good for several percent speedup on mainline. My original description: > > > > - It plugs a huge memory leak. After loading partial symbols for > > libc, GDB uses 5.6MB memory without this patch and 1.6MB with it. > > We weren't emptying the abbrev table. > > > > [Specifically, we were emptying it after dwarf2_build_psymtabs_hard, > > instead of once each time through the loop. dwarf2_read_abbrevs then > > zeroed out the allocated, unreferenced pointers.] > > > > - I spent a lot of time trying to find alternate data structures that > > would be more efficient. The expandable hash table is slower, even if > > you initially allocate it to the right size. The splay tree I expected > > to be quite good in this case, but it isn't either; the overhead is simply > > too high. The fixed-size ad-hoc hash table appears to be the best we can > > do. > > > > Tested on i686-pc-linux-gnu, no regressions. OK to commit? > > Looks great --- please do. OK, I've retested this and checked it in. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer