From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QND7L8ihtGNYyA4AWB0awg (envelope-from ) for ; Tue, 03 Jan 2023 16:44:40 -0500 Received: by simark.ca (Postfix, from userid 112) id C0DF91E222; Tue, 3 Jan 2023 16:44:40 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=w+Gvd5gD; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 71A751E0D3 for ; Tue, 3 Jan 2023 16:44:40 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9ADCE3858C33 for ; Tue, 3 Jan 2023 21:44:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9ADCE3858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672782279; bh=PrIfgVfTpX+rWe33n3S3V83M9BeAkmNj3qBT9exsOZI=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=w+Gvd5gDW56Hf6n/Ilaqy4eYlwl8nrtvPS+vuCdG2pYlEBjgZ6HKFjy8zvratO7GZ bb0pTsWeilhlN+qvE72ruKOGZm3VCIBp0HNWrE3LBQ3rvFGvLHIu8SesJKETlNFXNd s+GsLOaDot7vP/mZ2R4p4cJvvbfLt86cC2czThlw= Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id A2ABF3858D1E for ; Tue, 3 Jan 2023 21:44:18 +0000 (GMT) Received: by mail-wm1-x333.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so22142668wmb.2 for ; Tue, 03 Jan 2023 13:44:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PrIfgVfTpX+rWe33n3S3V83M9BeAkmNj3qBT9exsOZI=; b=4UYuRt0bum9oO2K0C2HUWrbF6Rls/RsLnMOSbU7hjR96JCerJ/RM0lLpC4zwWTbuPP Gz5CNyHilMwco7iPuTecQAMZ381gA89kk8D2Lu4AkDr+PzcAXwA81aa60y0rVqi7jPa2 Yktc+dyzsgHGxLIgCqLtmk6ZyFLfoOKUXiL1wCt7cA5pjyT41bPYZfOto0MMevTpVpV/ YMay2gvsN6/9NmMQr2t4WRcCfV1J39Agxb+GFs4Z5pGmo6kjxsvQaYQn5VAtmX9Jginx XrqnxfpOHf5UorZ1jv6vdR/rQ5JZp2H8Z7ETQEHV8CrKdw837FjER/LNnXLKAIN3dR+z 7OPg== X-Gm-Message-State: AFqh2kqiSjGkQDdx9bPzFCvK+3pIeGHZ0/Y1sCmwulg6gaYFZpu2eomu MHSlS/K7WWveTlzFdtjDwBQadnm+HCRBYXHJNnyGHnlv9FI/8cgU X-Google-Smtp-Source: AMrXdXsdtUJhoATWN3w1bJ5egqWwrrdvobyvlkkKirrsZogpOL1hmDsezvctxoLyW5tad66AT8sYTNbVYsMiYCTZrxU= X-Received: by 2002:a05:600c:a4e:b0:3d7:fa4a:6827 with SMTP id c14-20020a05600c0a4e00b003d7fa4a6827mr1863101wmq.188.1672782257335; Tue, 03 Jan 2023 13:44:17 -0800 (PST) MIME-Version: 1.0 References: <83h6xugc5v.fsf@gnu.org> <58b64bf8-90b6-d080-c060-d03761501199@arm.com> <83k02neezy.fsf@gnu.org> <835ye7e9jw.fsf@gnu.org> <87h6xrks77.fsf@tromey.com> <83mt7idacj.fsf@gnu.org> <87fsd4elb2.fsf@tromey.com> <83o7rs4qmg.fsf@gnu.org> <87cz84dasj.fsf@tromey.com> <835ydw20bw.fsf@gnu.org> <87wn6bbi5m.fsf@tromey.com> <83sfgz8m9i.fsf@gnu.org> <87o7rnb0ya.fsf@tromey.com> <83a6368chf.fsf@gnu.org> <87k02aaxc8.fsf@tromey.com> <83wn6a6n21.fsf@gnu.org> <587b899f-0f93-530a-7313-d4e1f9e501b9@simark.ca> <835ydt6jzw.fsf@gnu.org> <83wn63z81w.fsf@gnu.org> <46d7fd4b-d5f0-0007-3e88-20345e0e0584@simark.ca> In-Reply-To: <46d7fd4b-d5f0-0007-3e88-20345e0e0584@simark.ca> Date: Tue, 3 Jan 2023 16:43:34 -0500 Message-ID: Subject: Re: Two observations using GDB 13 snapshot To: Simon Marchi Cc: Eli Zaretskii , tom@tromey.com, gdb-patches@sourceware.org, luis.machado@arm.com Content-Type: text/plain; charset="UTF-8" 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: , From: Christian Biesinger via Gdb-patches Reply-To: Christian Biesinger Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On Tue, Jan 3, 2023 at 4:34 PM Simon Marchi wrote: > > > > On 1/3/23 15:34, Christian Biesinger via Gdb-patches wrote: > > On Tue, Jan 3, 2023 at 3:17 PM Eli Zaretskii wrote: > >> > >>> From: Christian Biesinger > >>> Date: Tue, 3 Jan 2023 14:44:56 -0500 > >>> Cc: Simon Marchi , tom@tromey.com, gdb-patches@sourceware.org, > >>> luis.machado@arm.com > >>> > >>>>> https://stackoverflow.com/questions/36686381/windows-c-runtime-toupper-slow-when-locale-set > >>>>> https://bugs.php.net/bug.php?id=45265 > >>>> > >>>> I couldn't see any numbers there about the performance of tolower > >>>> itself, i.e. how many ms per call does it take on Windows vs glibc. > >>>> But if someone can show a patch to try to eliminate the calls to > >>>> tolower, I can try and see if it affects the processing time in this > >>>> scenario. > >>> > >>> Seems like that could be tested by running gdb with LANG=C and/or > >>> commenting out the setlocale calls in gdb/main.c? > >> > >> Setting LANG in the environment doesn't have any effect on Windows, > >> since the Windows version of setlocale is insensitive to LANG and LC_* > >> environment variables. > > > > Well you could still try commenting out the setlocale call. > > > > In terms of the code, may be worth trying TOLOWER from > > include/safe-ctype.h instead of tolower() > > The tolower call is inside strcasecmp, we don't call tolower directly: > > #0 0x77c348d5 in msvcrt!__crtLCMapStringA () > from C:\WINDOWS\system32\msvcrt.dll > #1 0x77c348cd in msvcrt!__crtLCMapStringA () > from C:\WINDOWS\system32\msvcrt.dll > #2 0x77c30045 in wmktemp () from C:\WINDOWS\system32\msvcrt.dll > #3 0x77c1c992 in tolower () from C:\WINDOWS\system32\msvcrt.dll > #4 0x77c462a1 in stricmp () from C:\WINDOWS\system32\msvcrt.dll > #5 0x005107d3 in strcasecmp (__s2=, __s1=) > at d:/usr/include/strings.h:92 > #6 cooked_index_entry::operator< (this=, other=...) > at ./dwarf2/cooked-index.h:150 > > It would be interesting to change that strcasecmp call to strcmp, just > to see if it makes an impact on the performance. Whether or not that > would be correct is another thing, but it would help see if that > strcasecmp / tolower call is really at fault here. It looks like libiberty has a strcasecmp.c that could work, though I am not sure how one is expected to make sure that libiberty's strcasecmp is used. Christian