From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87377 invoked by alias); 8 Nov 2017 11:12:55 -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 87364 invoked by uid 89); 8 Nov 2017 11:12:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=1.8, love X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Nov 2017 11:12:52 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 724C8690D; Wed, 8 Nov 2017 11:12:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 724C8690D Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB75960017; Wed, 8 Nov 2017 11:12:50 +0000 (UTC) Subject: Re: [RFA 2/2] Simplify the psymbol hash function To: Tom Tromey , gdb-patches@sourceware.org References: <20171104161356.17565-1-tom@tromey.com> <20171104161356.17565-3-tom@tromey.com> From: Pedro Alves Message-ID: <92a5383c-5fd0-baee-fbaa-977669a3c613@redhat.com> Date: Wed, 08 Nov 2017 11:12:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20171104161356.17565-3-tom@tromey.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-11/txt/msg00166.txt.bz2 On 11/04/2017 04:13 PM, Tom Tromey wrote: > This patch simplifies the psymbol_hash function, by changing it not to > examine the contents of the symbol's name. This change just mirrors > what psymbol_compare already does -- it is checking for name equality, > which is presumably ok because symbol names are generally interned. Can you expand a bit more on the "presumably ok" part? I think it'd be nice to mention/explain this assumption in a comment in the code. > This change speeds up psymbol reading. "gdb -nx -batch gdb" > previously took ~1.8 seconds on my machine, and with this patch it now > takes ~1.7 seconds. That sounds great however I do wonder whether the bug is the other way around though. What do the statistics say, e.g., debugging gdb and firefox? Do we end up deduping more or fewer symbols in the bcache? I read the original thread that added these custom functions, and the original patch used strcmp in both hash and compare, and then somehow the end result was what we have today. See: https://sourceware.org/ml/gdb-patches/2010-08/msg00218.html and: https://sourceware.org/ml/gdb-patches/2010-08/msg00242.html So I'd love it that your patch is correct. I'd just appreciate a bit more detail since I'm not awfully familiar with this area. Thanks, Pedro Alves