From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic304-22.consmr.mail.ir2.yahoo.com (sonic304-22.consmr.mail.ir2.yahoo.com [77.238.179.147]) by sourceware.org (Postfix) with ESMTPS id 4BB1F3851C2F for ; Thu, 21 May 2020 15:04:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4BB1F3851C2F X-YMail-OSG: lYMrpvkVM1n_NlijTQLuJOyq40H0dn2kPWC_HcOPFyrTw0NjvzWEpfZXbUSp0HO Eep4vRPn6oj5mRkMutJuymU1VdrVgLwIGC8AE8qPMtD89CsU0Oxdfg9JuwWheOGiy82AKnISYks8 88NVEJB8ZmTm7IXq8zAL7bdDCHKv.RYl5iegzGK7ccXvShUaS_Wd6RUl7hF.UuXcisnAm6Nm2Qjj ossdgjmqr.ot2FPemBIoSdODHC1MEiMvTiVy02HlmsPxaPNF4mGZCL3.G7yumEtOxyov_RswljgN bAUxps2Jj2qWcgluQgBAENrZcBokGPGWuLSUz7cC.plw3uM2Y1V_7kh42O54WLwgn2oJa11zF7cx _t7yfzxaGNblx.jztS0pETYMQtCXZbU36L59qBmP_8PDq3iBgmxDs0iJvh2MSzf7seA.Tw87qkzd CKrml7CQaiHd4tgHly9zTyolddzBUCmT9wuxo4NYFCrC8htxZ5sjcLazDkzgcnxOT6QRwWaqTUNH 46Zu60qtTMl6gBtujYNJ2jJZguVibXKOiHiEE2BF4BxU1kUhoND4T58s9hgE_NZBLmX0Lt.cdmG7 fpdU3S0niZQnOmsgRcVoixapS_lrgeOK6l_yPW0aRX_dQfKzvetMLhTb97CHd9G6gpkoupMGyQRf BZT5MidlpQ0iqCpGjY1O_F7dGi.qjQ1fzFw0phFEZgATDsOamHH9OqJTYbfscMM_11L7SXko_U1v aqvh08TcSN3nCgyKbH_Xok2gPNFJZZb2B.hu065SItE_UbT7MMugg6mEzSBIGH4yCh5OEq0puk72 5I6AyH9fSBovMYPRFTEIWQgZNAq_WfzTjZkomqN4kqRWnH_KkRlpmPlhblfZXMz57sH3Mwtl2V7E qQ1qgFLFYvNWRf44kMhR4GqNl9VJEomiQ.ZaCJ_0Fh_CKHfyDVHhtFGyIO.8_hNUqcUYwgL9Y59t T7.ruweotyZ81OaW6PuTWK4hSft7D6X.FKaoBsvb1C1TfUYSAoaBlhs66Y4QL6LupGQK2OMwjp8W UU3NZLX1O8mHB4hcGaUNb9Vlp5QEeP9mN.VKWkbXPE17Hs_h8Qm0wyPkFU90rPWxQvK9Jp2I1jlt DTvhC.P4zEQqTqOWqOvTY1uo6MBs6K8ofMwYE8DwMmhXvC1zhHRp3xJR81ENeYdeWEwO7ndkBfSB WGdzv6qlaRg5mYJ0m0Kcu6vY3Wk0BKz4TcNanJreoBc7b2A3Cj2P1rbB21VVDbkQnbiqpcJm2BQS oCzAvwm._U1iMw4piVn6EqfdaePPEZc.wjOjrTNuJvy_Qz1iCcg_TFljKmi6GUnOjiplIxhH_S3Y nFn4mX8UbEVn_GA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ir2.yahoo.com with HTTP; Thu, 21 May 2020 15:04:00 +0000 Date: Thu, 21 May 2020 15:03:57 +0000 (UTC) From: Hannes Domani To: Gdb-patches Message-ID: <1561975515.2543878.1590073437956@mail.yahoo.com> In-Reply-To: <57ffa2a6-6636-d50c-a058-5244c41e0e96@redhat.com> References: <20200520174032.9525-1-tromey@adacore.com> <20200520174032.9525-2-tromey@adacore.com> <402931801.2106918.1590023319120@mail.yahoo.com> <57ffa2a6-6636-d50c-a058-5244c41e0e96@redhat.com> Subject: Re: [PATCH 1/4] Attribute method inlining MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.15960 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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 15:04:02 -0000 Am Donnerstag, 21. Mai 2020, 16:26:12 MESZ hat Pedro Alves Folgendes geschrieben: > On 5/21/20 2:08 AM, Hannes Domani via Gdb-patches wrote: > > >=C2=A0 Am Mittwoch, 20. Mai 2020, 19:40:44 MESZ hat Tom Tromey Folgendes geschrieben: > > > >> I ran gdb 10 times like: > >> > >>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /bin/time -f %e \ > >>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 ./gdb/gdb --data-directory ./gdb/data-directory -nx \ > >>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 -iex 'set debug-file-directory /usr/lib/debug' \ > >>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 -batch $X > >> > >> ... where $X was the test executable.=C2=A0 Then I computed the mean t= ime. > >> This was all done with a standard (-g -O2) build of gdb. > >> > >> The baseline times were > >> > >> gdb=C2=A0=C2=A0=C2=A0 1.90 > >> libxul 2.12 > >> Ada=C2=A0=C2=A0=C2=A0 2.61 > >> > >> This patch brings the numbers down to > >> > >> gdb=C2=A0=C2=A0=C2=A0 1.88 > >> libxul 2.11 > >> Ada=C2=A0=C2=A0=C2=A0 2.60 > > > > When I saw this, I thought I could do a similar profiling test on Windo= ws (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) > > { > >=C2=A0=C2=A0 return c =3D=3D 0x20 || (c >=3D 0x09 && c <=3D 0x0d); > > } > > #define isspace isspace2 > > > > static inline int tolower2 (int c) > > { > >=C2=A0=C2=A0 return (c >=3D 'A' && c <=3D '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 h= ave 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.=C2=A0 Let me try to dig it = up. You're right, I found it here: https://sourceware.org/pipermail/gdb-patches/2019-June/158285.html So I guess it's not just on Windows that slow. And you replied that we maybe should use TOLOWER, ISXDIGIT from libiberty instead: https://sourceware.org/pipermail/gdb-patches/2019-June/158518.html I tried to do that, but the safe-ctype.h defines clash with the ones of chardefs.h: In file included from C:/src/repos/binutils-gdb.git/gdb/utils.c:62: c:\src\repos\binutils-gdb.git\include\safe-ctype.h:89: error: "ISALPHA" red= efined [-Werror] =C2=A0=C2=A0 89 | #define ISALPHA(c)=C2=A0 _sch_test(c, _sch_isalpha) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | In file included from c:\src\repos\binutils-gdb.git\readline\readline\keyma= ps.h:35, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 from c:\src\repos\binutils-gdb.git\readline\readline\= readline.h:37, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 from C:/src/repos/binutils-gdb.git/gdb/utils.c:61: c:\src\repos\binutils-gdb.git\readline\readline\chardefs.h:91: note: this i= s the location of the previous definition =C2=A0=C2=A0 91 | #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha ((unsi= gned char)c)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | Not sure how to solve this. Hannes