From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121088 invoked by alias); 7 Oct 2018 22:04:16 -0000 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 Received: (qmail 121068 invoked by uid 89); 7 Oct 2018 22:04:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=noise, worry, frequently, followed X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 07 Oct 2018 22:04:14 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 4D33A1E52B; Sun, 7 Oct 2018 18:04:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1538949852; bh=p94o1wLFUi32mtQPW16c02/5yH9frKYI3yoXjkPCq90=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=XpIuTgM8un+K9lu3jHrGGkCCEeqN5v2xjH+5GKxezY5b+Wo3BDyy0XneboN+bwEPs Q/2MwrU1fbXjEvsq9zrq9muRr+6biR+jYxLXVDafcyt7SFMKUkPV7ppYN4xsqN8vHc 3uUHrtwquTEyaJ3+EzgEIpX5mOv/kSY6wJyhVNUU= Subject: Re: [RFA 08/15] Remove readin and compunit_symtab fields from psymtab To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20180510222357.27332-1-tom@tromey.com> <20180510222357.27332-9-tom@tromey.com> <5f8f38c4-8b4b-9fea-b9f2-7c69758a09c2@simark.ca> <87lg7mi5al.fsf@tromey.com> <87zhvreujr.fsf@tromey.com> From: Simon Marchi Message-ID: <0f59e2a3-b9e2-511c-7807-b7a68a8df1cf@simark.ca> Date: Sun, 07 Oct 2018 22:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <87zhvreujr.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-10/txt/msg00162.txt.bz2 On 2018-10-05 9:24 p.m., Tom Tromey wrote: >>>>>> "Tom" == Tom Tromey writes: > >>>>>> "Simon" == Simon Marchi writes: > Simon> As Pedro pointed out a few times, unordered_map is an hash map with open > Simon> hashing. So we change what was previously a single pointer dereference > Simon> to a lookup in a hash table, followed with a linear search in a linked > Simon> list. If this map is looked up very frequently, maybe we should consider > Simon> using an htab_t instead? Some profiling data would help, but it seems > Simon> like psymtab_read_in_p is called quite a bit when looking up symbols... > > [...] > > Tom> I still haven't tried any performance measurements. > Tom> I'm not quite sure what to try. > > I ran the gdb.perf tests and on some tests, it seems that the results > are within the noise; but on backtrace (2048) and skip-function-3000 (4000) > gdb is about 4% slower. I don't know if this is enough to worry about. > > Tom > That sounds like a reasonable trade-off in exchange for the feature of decoupling psymtabs from objfiles. Perhaps we can put it on the list of "candidates for htab_t" (could be a comment next to the field), for when we finally bring the C++ wrappers from gcc :). Simon