From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25025 invoked by alias); 26 Feb 2004 22:09:41 -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 25017 invoked from network); 26 Feb 2004 22:09:40 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 26 Feb 2004 22:09:40 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id i1QM9eb01327 for ; Thu, 26 Feb 2004 17:09:40 -0500 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i1QM9c803460; Thu, 26 Feb 2004 17:09:38 -0500 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com, Elena Zannoni Subject: Re: [RFA/dwarf] Allocate abbrevs from a new obstack References: <20040225035543.GA13672@nevyn.them.org> From: Jim Blandy Date: Thu, 26 Feb 2004 22:09:00 -0000 In-Reply-To: <20040225035543.GA13672@nevyn.them.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-02/txt/msg00779.txt.bz2 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.