From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97187 invoked by alias); 21 Jun 2019 21:14:09 -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 97178 invoked by uid 89); 21 Jun 2019 21:14:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*RU:209.85.128.65, HX-Spam-Relays-External:209.85.128.65 X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Jun 2019 21:14:07 +0000 Received: by mail-wm1-f65.google.com with SMTP id f17so7828461wme.2 for ; Fri, 21 Jun 2019 14:14:07 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id 128sm4541617wme.12.2019.06.21.14.14.04 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jun 2019 14:14:04 -0700 (PDT) Subject: Re: [PATCH] Fix slow and non-deterministic behavior of isspace() and tolower() To: Shawn Landden References: <20190610213017.2021-1-shawn@git.icu> <20190621191959.24450-1-shawn@git.icu> <325f6653-a7ae-1242-53f6-b004f6edca37@redhat.com> Cc: gdb-patches@sourceware.org, jhb@freebsd.org, Eli Zaretskii From: Pedro Alves Message-ID: <3884097b-e834-e687-9916-7d4242960273@redhat.com> Date: Fri, 21 Jun 2019 21:14:00 -0000 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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-06/txt/msg00448.txt.bz2 On 6/21/19 9:30 PM, Shawn Landden wrote: > On Fri, Jun 21, 2019 at 3:12 PM Pedro Alves wrote: >> On 6/21/19 8:19 PM, Shawn Landden wrote: >>> I was getting 8% and 6% cpu usage in tolower() and isspace(), >>> respectively, waiting for a breakpoint on ppc64el. >>> >>> Also, gdb doesn't want non-deterministic behavior here. >>> >>> v2: do not touch C namespace >>> v3: Turns out there are two places using these in performance-critical >>> parts. >>> Follow GNU coding standards. >> This doesn't address my comments about >> . >> >> Something like this. How does this compare? Any significant >> difference in your benchmark? And again, how are you benchmarking >> this? > perf record. What was the use case? Did you have some speficic set of commands? Some script? Please be detailed/more specific, so that others can reproduce it, either now, or in the future when we look back into this thread. > goes from like 6-8% to almost nothing (if you remove the static). What do you mean by "remove the static"? Thanks, Pedro Alves