From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20875 invoked by alias); 1 Mar 2019 18:51:52 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 20808 invoked by uid 89); 1 Mar 2019 18:51:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:PHrt, Hx-languages-length:4419, H*i:sk:87lg1yh, 27s X-HELO: sonic313-22.consmr.mail.ir2.yahoo.com Received: from sonic313-22.consmr.mail.ir2.yahoo.com (HELO sonic313-22.consmr.mail.ir2.yahoo.com) (77.238.179.189) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Mar 2019 18:51:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1551466307; bh=1kp4+oVLuvEpsvxubMWO0OfqV7+AFgzMfMiE7cuKHeI=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=MHAOQiyVre9O/haecktBgWADtLlTpCHUOgeh4AxqQPteFuYZBo3wz9D+zaP9s7oNOLwR0PxzC4xK2MfcPKNfRRYFu7uRMeQkiamCfh8ehWpLtQa1OzY4WAJGMedZsO/zSnroU5Cxhl2E2nbuu+uhnqUwhZs69kMg6WvcYBW86LFtHnV7whu2Sj7LhPm59qYXKnsNcpJ9LrY6B+Xm1Qu08QiVH45MjNU+Re2cvb/q+ezQJWeDLLQC7Jrc+cHDXap/YcGuk307n5CFx72kIZCDfrN6jy7B9RpxUI8sUSqMxkHt+H/2t6TtCZiqJTFZzdfUU8uPfy+nFw1YRtCOGa3G6w== Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ir2.yahoo.com with HTTP; Fri, 1 Mar 2019 18:51:47 +0000 Date: Fri, 01 Mar 2019 18:51:00 -0000 From: "Hannes Domani via gdb" Reply-To: Hannes Domani To: GDB Development Message-ID: <1682009983.12256919.1551466302655@mail.yahoo.com> In-Reply-To: <87lg1yh2gx.fsf@tromey.com> References: <183519794.10360727.1551304006549.ref@mail.yahoo.com> <183519794.10360727.1551304006549@mail.yahoo.com> <87h8copz0d.fsf@tromey.com> <1428427467.10799860.1551353565332@mail.yahoo.com> <87lg1yh2gx.fsf@tromey.com> Subject: Re: question about expand_symtabs_matching() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00002.txt.bz2 Am Freitag, 1. M=C3=A4rz 2019, 19:30:56 MEZ hat Tom Tromey = Folgendes geschrieben: > Personally I'd be fine with changing the syntax of the more obscure > linespecs ("function:label" is probably not used much in practice) in > order to make the parsing more sane, if it had a performance benefit > here.=C2=A0 But that's just me. I didn't even know before I started looking into this that function:label is possible. > Also, a negative result is still a parse result; so if a linespec > understood which objfiles had been searched, it could still easily skip > this work on dlopen or dlclose. If you mean that it should only search the newly loaded shared library, then yes, I agree. > Hannes> Similar, for the case of a simple function name as pending breakp= oint, > Hannes> it's cp_canonicalize_string_no_typedefs() called by find_linespec= _symbols(), > Hannes> that's taking most of the time. > Hannes> And I'm wondering if this call is necessary if you only use the f= unction name > Hannes> without arguments (like 'function' or Class::member_function). >=20 > I doubt it's needed but on the other hand it may not really save much. > Maybe one way to do the experiment is check the string for > non-identifier characters before trying to canonicalize it. For the case of 'b some_function', with the application I'm testing: - startup time with the call of cp_canonicalize_string_no_typedefs(): 1m 25s - startup time without this call: 27s > Hannes> If you are interested, I could also send you the profiling flameg= raphs. >=20 > It's an area I'm interested in but I'm not actively working there right > now.=C2=A0 If you're interested at all in gdb development ... on the one = hand > tackling linespec caching is maybe a difficult project, but on the other > hand it seems fun :-) In my personal build I've changed this: - only call cp_canonicalize_string_no_typedefs() if it's not a simple funct= ion =C2=A0 name (like 'function_name' or 'Class::member_function') - only call expand_symtabs_matching() if the lookup_name doesn't contain a = '.' I admit that I don't fully understand what could break with these changes, but the speedup makes it worth for me right now. Regards Hannes Domani