From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16870 invoked by alias); 11 Feb 2008 17:43:42 -0000 Received: (qmail 16862 invoked by uid 22791); 11 Feb 2008 17:43:42 -0000 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO qnxmail.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 11 Feb 2008 17:43:25 +0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.42.96.5]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id MAA18913; Mon, 11 Feb 2008 12:28:49 -0500 Received: from [10.42.100.129] (dhcp-100-129 [10.42.100.129]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id MAA26063; Mon, 11 Feb 2008 12:43:18 -0500 Message-ID: <47B08936.7080909@qnx.com> Date: Mon, 11 Feb 2008 17:43:00 -0000 From: Aleksandar Ristovski User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb-patches@sourceware.org Subject: Re: [RFC/patch] Sort global symbols in psymtabs only if needed References: <47B075A2.5010207@qnx.com> <20080211164335.GA15268@caradoc.them.org> In-Reply-To: <20080211164335.GA15268@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00176.txt.bz2 Daniel Jacobowitz wrote: > On Mon, Feb 11, 2008 at 11:19:46AM -0500, Aleksandar Ristovski wrote: >> The attached patch sorts on first lookup instead of on load. > > Does this help if you benchmark any non-trivial debug sessions? > You've sped up startup, but the first call to lookup_symbol is going > to search a large number of such psymtabs. The full price will probably be paid with longer debug sessions, but it definitely improves time to "stopped in main". > > Also, you probably know this, but be careful using gprof for this sort > of thing. I recommend oprofile. gprof artificially inflates the cost > of small frequent functions like strcmp_iw_ordered, because of all the > overhead. No, the delay really comes from there, I used wall-clock timings as well, but thought this is more representative. > > The patch may still be a good idea. Can we eliminate the binary > search / sort entirely? We do hash table lookups for full symtabs; > that should be faster than sorting. See dict_create_hashed. > > Those are all hardwired to "struct symbol" at the moment. But > I think it only uses SYMBOL_SEARCH_NAME, so it could work with > psymbols too if we passed the ginfo around. > > I haven't investigated this, but I will take a look... So we would only hash and use hash lookup for both psymtabs and symtabs. It sounds to me as something doable.