From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic309-26.consmr.mail.ir2.yahoo.com (sonic309-26.consmr.mail.ir2.yahoo.com [77.238.179.84]) by sourceware.org (Postfix) with ESMTPS id 8E867385DC0A for ; Thu, 21 May 2020 01:08:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8E867385DC0A X-YMail-OSG: Qfi4p_YVM1nyZdwnptjCg_xrdN9FnF6cZpSp7MR3869jJZB8Z9KFHY11KcRPtPn ebC1tEZSo77jFnto2sQDN5I2gZo9xL.6mxlf_foGl9iL_f59upzykkY.OoHOInI6dU6TnrMEPwa6 9sO5.vePh9ER5Ya15BxzrogQOeMByOJC6HAYeqw4n16Id0HRVCao2fA9GZ216qQPGznD3A1qjfYF yLrqIpqDTTcq5o3VyYNA9coyP3AxL5MFBfvCHjvZQx7qFYK9FxBzD6YhRZKL5eKBoqnaTZOpyyw_ d5xxdTvVBfdMQq3bgFUr8VkSQeaNQMEuEYe5rTTSNEo8RXyxpIwqnUlRAi.SKAwrvSQms7d07qvm XvX2tmhZnluC_FcBTLmKK2vBZdwnHsOcD1FlRyyeFHayOfYqIl_HzS2PWHeJUpxXhLIJftGthspR n5xA8Uhn52UaokNrSgGiITgu_g2rRJB1gjBRqKbUsbGPX544e.AttcVYRF9UV8ce_x81FEkSDHP5 3L3Oy8fRnfi9hIsGE9HjqFD2pPRCrpBRdgUhT299ADA_P3bbvaeWH5e6D5i5EEjWz.UbfEimGpF0 gTGEzvf8jFsTo0r7TnIrlYsEuAQr4Lcf0sekw8SqyLc38nDuNP0pPyqJeMJlFO4B81IXGO2qwNbM fpqnzGxSn9wnuFug_S0zzYivypDHlhwS3traBAjtzk_ZWsmGtHHE7D3iPsSmqG6evDmJkjtSHvb2 z4mLKXSNEzgDdLbsG9_P5HGH7afiq4OKZ0w6gBz8KmabE05Dc1f8MxKtei4RRQnRZImT9da0XeTc qPiZ7UqDA8_BO4BfUyshbbsTe5n7puC5M4DCQO0TaZxKoTZwktcomAELKqNGIFrwICzAo6xl_PMa tQ7ismlJ_m1uUWSJkeWJODYCOXQElpbWVXGmcd3p1H0NqEYzv5sP.vT.1S7SNVob77p6RdU7qzI_ YEKzj2SVFWaYDJ1.soMIQSQLFdZ5oU0A.s5ogW2HEdFNMOA_FtKdzj9qkN41zTcbedubtPejgLGo isD6ixy0Rcf__mIwjh0uNiiJn2x9Vlskdxbxpl9zW_o2dz.X21sJMrEDyjrCOGIaDq648YgBW8XA tGMbGhqZ2h575q_vJeKVVmmruLiT.ldpaO9eMXW_i7YEUpp5tI_It5iV7WRJFY7QpGPGmN5RAOm7 G1YvzbKMDJT73MlZvD_BcsOAO0AFDc1EBNZu2zzZiBvcQlGJ_RCosDqB3plx_xlyeQONgQrNsU0w WxD.8j7mNw31ytQKs7LT5hIyQkSm32_2GPbfTddbKv5O_KtMx.emAL9hRN2n4vg8fV77J2nSQeGE AWWkkzp4- Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ir2.yahoo.com with HTTP; Thu, 21 May 2020 01:08:42 +0000 Date: Thu, 21 May 2020 01:08:39 +0000 (UTC) From: Hannes Domani To: Gdb-patches Message-ID: <402931801.2106918.1590023319120@mail.yahoo.com> In-Reply-To: <20200520174032.9525-2-tromey@adacore.com> References: <20200520174032.9525-1-tromey@adacore.com> <20200520174032.9525-2-tromey@adacore.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=-2.5 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 01:08:44 -0000 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 /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 .= /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 -= 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 -= 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 Windows (= 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 return c =3D=3D 0x20 || (c >=3D 0x09 && c <=3D 0x0d); } #define isspace isspace2 static inline int tolower2 (int c) { =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-graphs) Hannes