From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PrIfgVfTpX+rWe33n3S3V83M9BeAkmNj3qBT9exsOZI=; b=O6qYGSKLtExuiJS4ino/E66qCugaX56AQ2AIdAfzdvaIONMG2yf+wK4v4mbXuecop7 Xxg5O6LOv8vIry0tiG8cVChaICOJQMfhee0vmWmg70vbqfw4hR9RSNygMiQCJEkvvj6T xyvRgZWIqoV7+/E3mDWutwlQlSxWMLW0AhG+4m7EVQ5yz0sZppvJDKTK5lXoQ9oOJMUl o/MloM6jJCzOgEiqVOZlaMJF5buCeDGPvqZzjzouNooALlPze78Jm7nR0PNUkbIeP8Xr ZE/UW1DCpYoYNfoz8HKrHL/77mcpH6fhFYyHk/DfWEmgxItAw2mi+6AN54y9TH+mg98g UJPg== 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> From: Christian Biesinger 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-Spam-Status: No, score=-18.3 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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