From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic306-20.consmr.mail.ir2.yahoo.com (sonic306-20.consmr.mail.ir2.yahoo.com [77.238.176.206]) by sourceware.org (Postfix) with ESMTPS id B01EC386F80C for ; Thu, 21 May 2020 17:18:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B01EC386F80C X-YMail-OSG: 7.fX.PoVM1kmCLVQVJeQgTAv3r7TRcIXpvuBKU.G88tWGSp_QbC71DG4xN3GstQ xV8A8t0YUh8gr9n6QuMmbINoBs7mDwPqItu13WOyK_nssp78a43hA1k1GpMWzsKYrd5Hlumcc.w8 Bk1gSDDgIsURdQkWT1zeOoSNYg9fNiagrUPDZvS6AsIhXV604GuTXqgIzOpkkr9TZXh2SXVSce4n wH1i_Z7dY6q_TSkgZtAp_GowM7snUbLPlSjYBvY4yruXd3AeTwQOhYuwnlY.3NBYp2mdCnFJ7FZp IBTa3HvgbiAibObL1Q_z7T61EECnHyt8iRO.gvji0mb04hFmoB8ZZZQMIx8.AuSSQgHNeZsft5wQ o2UXfgGBV3klpx5Oa7_7DoOeyAjqLyzx3jqo6GErecmF5lZiVYFRTNeGAVmW_IfpWKnZbQ9NnHOZ upUFQnAriuxG6Uh5hMRFxTc1NGZtqjX8uuEdKMIAOz.PZvGrghqzmWchtTj7Eu1.TYydX.8.h2KX I9cClS2NOeU9EdSTwFd6gdiXhGnQaGTVvsoeew3HyCvBQks2TWb1BRvcSYNRahQC5a9LnNofnHAD 6B5mxyDxOxMo9CiMRm1YRJT7ESsO2HmCTorU05Jz6ytui9SXy_o2H.x2uhVDzINXretCaxTLCDqs PHQbCFWVFGg3YZcH1BBUfmfp8hiVCO3xjG499NWdsSvu3khP30L2MWpJfR3O4grOCnBdXXNOveYm EWi_4K1ht_kIY1HFN3Z67OkF4ykRn462AsSW9NiCDJUOObkMMyYIbQvfkg1L34nluJ2pEmB9lznF vDcr75BBsm3ZWxrhl96ICkBVTwkDm143yu_nefD4Eg5.68DtMzzKwtgzAz7I.U2U7BPni_8pHLfb WgzeR.6fOOIzVcWzjWI1bPN8TZ.JqvcigKT7DJ2tuT9YARh9FgpXIXU4.hx0ZTM4LhaK.qrH8rTi BZBcXx6qVv.4GDVkuBtxG99MMAG3j9QgMpeWKB6dzlaQp6oLXoXpivI8mLGeLm1xXX1OsBoz3KJm gGwwHYgKrr_npnl57zukCxvCX_CW8G7cjOms4v2e9QaA7_vFVKSYwcdXYDJWVNfdfzHzez.6NJhL ImCreTjfQg1Es_72.zP6PblY6yLAW_q09O7EXyGJ8vShZkvncMq4QMaVh3pu.G1ZBc65ADFZUA3t D8IVtJr8s2ISz5432XpTj0iiBvJJI0jXbLnMu7OVe1_cdExaSs4Fue5s5SFnVX8_PHNWs6s4UUAz vhLM31WeaQT366kmQgFQC8Q.Acy3O_RaaCZ.3lF7SIOuJXnaPhCqTtTz.GYKK.tm5vXD4j4zcDqL v1MdK72fWL8ut6Q-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Thu, 21 May 2020 17:18:27 +0000 Date: Thu, 21 May 2020 17:18:20 +0000 (UTC) From: Hannes Domani To: Gdb-patches Message-ID: <527321070.2641378.1590081500100@mail.yahoo.com> In-Reply-To: <3b5b38b1-ccf2-199b-d2cd-c17e86659000@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> <1561975515.2543878.1590073437956@mail.yahoo.com> <3b5b38b1-ccf2-199b-d2cd-c17e86659000@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.1 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 17:18:30 -0000 Am Donnerstag, 21. Mai 2020, 18:42:23 MESZ hat Pedro Alves Folgendes geschrieben: > On 5/21/20 4:03 PM, Hannes Domani via Gdb-patches wrote: > >=C2=A0 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=C2=A0 Am Mittwoch, 20. Mai 2020, 19:40:44 MESZ hat Tom Tromey <= tromey@adacore.com> Folgendes geschrieben: > >>> > >>>> I ran gdb 10 times like: > >>>> > >>>>=C2=A0=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=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=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=C2=A0 -batch $X > >>>> > >>>> ... where $X was the test executable.=C2=A0 Then I computed the mean= time. > >>>> 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 Win= dows (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=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=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= 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-graph= s) > >> > >> > >> 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 > > Yes, that's the one! > > > > > So I guess it's not just on Windows that slow. > > > > And you replied that we maybe should use TOLOWER, ISXDIGIT from libiber= ty > > instead: > > https://sourceware.org/pipermail/gdb-patches/2019-June/158518.html > > This message is actually older than the patch above -- I wrote the patch > afterwards. > > The patch is using the libiberty macros, and avoids the readline clash > you run into.=C2=A0 Could you give it a try? It wasn't immediately obvious to me, but I think you mean this one: https://sourceware.org/pipermail/gdb-patches/2019-June/158525.html I tried it, and as expected, I get the same speedup as with my previous test, and strcmp_iw_ordered is now in only ~1.5% of the profiling samples. Hannes