From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 20716383E81B for ; Wed, 20 May 2020 21:08:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 20716383E81B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.193] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 7680A1E76A; Wed, 20 May 2020 17:08:06 -0400 (EDT) Subject: Re: [PATCH 0/4] Micro-optimize DWARF partial symbol reading To: Tom Tromey , gdb-patches@sourceware.org References: <20200520174032.9525-1-tromey@adacore.com> From: Simon Marchi Message-ID: <784eb14a-4567-e134-d864-63cc6141a235@simark.ca> Date: Wed, 20 May 2020 17:08:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200520174032.9525-1-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: Wed, 20 May 2020 21:08:08 -0000 On 2020-05-20 1:40 p.m., Tom Tromey wrote: > A personal goal of mine is to improve the startup time of gdb. In the > long run, I think the answer lies partly with threading, and perhaps > with a more radical rewrite of the DWARF psymbol reader. However, > those are difficult goals; and in the short term, I found that just > profiling the reader and making small improvements can make a > difference. > > This series improves the performance of the DWARF partial symbol > reader about 10% (more in one case) on some real-world executables. > See the first patch for details (I chose to put the details there so > they would end up in the eventual git log). > > Regression tested on x86-64 Fedora 30. > > Let me know what you think. > > Tom I tried the series as a whole, with these two files, libxul.so, which reads this debug info file: $ l /usr/lib/debug/.build-id/06/bc3dd11d2331977ff78ce8e18c59216a8b9a61.debug -rwxrwxr-x 1 root root 1.5G May 8 12:21 /usr/lib/debug/.build-id/06/bc3dd11d2331977ff78ce8e18c59216a8b9a61.debug and libwebkit2gtk-4.0.so.37.28.5, which reads this debug info file: $ l /usr/lib/debug/.build-id/77/5b4022ee4a85d12697b8791001b40570c25f98.debug -rwxrwxr-x 1 root root 1.4G Aug 15 2018 /usr/lib/debug/.build-id/77/5b4022ee4a85d12697b8791001b40570c25f98.debug So both are about the same size. This is without the patchset applied $ for i in 1 2 3 4 5; do time ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch; done ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 97.10s user 1.81s system 102% cpu 1:36.94 total ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 97.61s user 1.96s system 102% cpu 1:37.55 total ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 99.33s user 1.90s system 101% cpu 1:39.34 total ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 96.87s user 1.95s system 101% cpu 1:36.92 total ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 97.19s user 1.94s system 102% cpu 1:37.10 total $ for i in 1 2 3 4 5; do time ./gdb -nx --data-directory=data-directory /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.28.5 -batch; done ./gdb -nx --data-directory=data-directory -batch 96.66s user 1.27s system 101% cpu 1:36.76 total ./gdb -nx --data-directory=data-directory -batch 95.63s user 1.45s system 101% cpu 1:35.92 total ./gdb -nx --data-directory=data-directory -batch 92.45s user 1.24s system 101% cpu 1:32.62 total ./gdb -nx --data-directory=data-directory -batch 96.55s user 1.45s system 101% cpu 1:36.85 total ./gdb -nx --data-directory=data-directory -batch 92.75s user 1.34s system 101% cpu 1:32.93 total And this is with the patchset applied: $ for i in 1 2 3 4 5; do time ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch; done ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 58.08s user 1.71s system 103% cpu 57.780 total ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 57.89s user 1.75s system 103% cpu 57.618 total ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 57.85s user 1.67s system 103% cpu 57.492 total ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 58.03s user 1.85s system 103% cpu 57.883 total ./gdb -nx --data-directory=data-directory /usr/lib/firefox/libxul.so -batch 58.16s user 1.73s system 103% cpu 57.833 total $ for i in 1 2 3 4 5; do time ./gdb -nx --data-directory=data-directory /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.28.5 -batch; do ne ./gdb -nx --data-directory=data-directory -batch 57.81s user 1.17s system 102% cpu 57.788 total ./gdb -nx --data-directory=data-directory -batch 57.60s user 1.27s system 101% cpu 57.728 total ./gdb -nx --data-directory=data-directory -batch 57.75s user 1.18s system 101% cpu 57.847 total ./gdb -nx --data-directory=data-directory -batch 57.33s user 1.19s system 102% cpu 57.318 total ./gdb -nx --data-directory=data-directory -batch 57.95s user 1.17s system 101% cpu 57.967 total It's still a bit too long for an interactive user to wait, but it's quite an improvement! Simon