From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 156F9383E800 for ; Thu, 21 May 2020 14:26:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 156F9383E800 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-rhxWKK4sOXCog2ZxDpzRuQ-1; Thu, 21 May 2020 10:26:09 -0400 X-MC-Unique: rhxWKK4sOXCog2ZxDpzRuQ-1 Received: by mail-wr1-f71.google.com with SMTP id p13so3001024wrt.1 for ; Thu, 21 May 2020 07:26:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4Z6HYtEJ/9KPTFPf45AlgDeDnZiGqRIPD2s+mkWA08w=; b=jRtQ1Hl0LqBnFi3JrqLD4YemMP28DBPdqDtHnX2JN8IT5W1zq74931apJ2bEx1V2cg LIsylSOx2ooYTu1DcugTiYfE/iSZoKhEyzDYO5qiPZOytEnHnJWhGzasQzNVoTB4DpEg p0PVfmMVaWsa+TtYvEfwaBi0opypbq1kPoViJ5ej8L3QrkpjRNzuHtazEQQnjh1YWDJ2 hs47hteq5qlOksi6oaqKnF2W2SkaEeQVOckUPmb9JFaN15NxwZsKmIM1jkbwkshjTz8N LfRvhdP+mt0l/hPw97keAG4T+jIrU0KsGlNzqglI7gXfwLzG3PVA37EV71bu69OvcyU1 usNA== X-Gm-Message-State: AOAM532j59KXAa0/XxSRzYjBrYw3uPQkbBINnNy0rBENw7Z1rmyaVeWb jnTTl4tuhs7qTOMEvEJn3kcJd3gm0j0o3SAOl4qLU9QIlwH9uhZRU0Mt4uvZpZ7TUenE9VG8+rM iUwzldElCGlFN1pp1ffHqdQ== X-Received: by 2002:adf:e80e:: with SMTP id o14mr8735296wrm.307.1590071167685; Thu, 21 May 2020 07:26:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxocyuBC8EnvycDmVGRX3PHeHjetocw4wJeUMSnoB/N2II3CzyYaGUSCxYMuu1cD00j3sXupA== X-Received: by 2002:adf:e80e:: with SMTP id o14mr8735278wrm.307.1590071167435; Thu, 21 May 2020 07:26:07 -0700 (PDT) Received: from ?IPv6:2001:8a0:f909:7b00:56ee:75ff:fe8d:232b? ([2001:8a0:f909:7b00:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id x184sm6861624wmg.38.2020.05.21.07.26.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 07:26:06 -0700 (PDT) Subject: Re: [PATCH 1/4] Attribute method inlining To: Hannes Domani , Gdb-patches References: <20200520174032.9525-1-tromey@adacore.com> <20200520174032.9525-2-tromey@adacore.com> <402931801.2106918.1590023319120@mail.yahoo.com> From: Pedro Alves Message-ID: <57ffa2a6-6636-d50c-a058-5244c41e0e96@redhat.com> Date: Thu, 21 May 2020 15:26:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <402931801.2106918.1590023319120@mail.yahoo.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 14:26:12 -0000 On 5/21/20 2:08 AM, Hannes Domani via Gdb-patches wrote: > Am Mittwoch, 20. Mai 2020, 19:40:44 MESZ hat Tom Tromey Folgendes geschrieben: > >> I ran gdb 10 times like: >> >>        /bin/time -f %e \ >>              ./gdb/gdb --data-directory ./gdb/data-directory -nx \ >>              -iex 'set debug-file-directory /usr/lib/debug' \ >>              -batch $X >> >> ... where $X was the test executable.  Then I computed the mean time. >> This was all done with a standard (-g -O2) build of gdb. >> >> The baseline times were >> >> gdb    1.90 >> libxul 2.12 >> Ada    2.61 >> >> This patch brings the numbers down to >> >> gdb    1.88 >> libxul 2.11 >> Ada    2.60 > > When I saw this, I thought I could do a similar profiling test on Windows (but > only with gdb itself). > > So just: gdb.exe -q -batch gdb.exe > > And I was a bit suprised to see that strcmp_iw_ordered (called from > sort_pst_symbols -> std::sort) is in ~24% of the profiling samples. > And only because of the functions isspace and tolower. > > So I made a simple test, and added this before strcmp_iw_ordered: > > static inline int isspace2 (int c) > { >   return c == 0x20 || (c >= 0x09 && c <= 0x0d); > } > #define isspace isspace2 > > static inline int tolower2 (int c) > { >   return (c >= 'A' && c <= 'Z') ? c + 0x20 : c; > } > #define tolower tolower2 > > And the mean time went from 3.7s down to 2.7s. > > > I'm not saying this is a correct solution, but does strcmp_iw_ordered have to > support anything besides the "C" locale? > > Also, are isspace and tolower only on Windows a bottleneck? > > (If anyone wants to see them, I can provide some profiler flame-graphs) There was a patch for this not that long ago. Let me try to dig it up. Thanks, Pedro Alves