From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id parRE4LD82cTLyoAWB0awg (envelope-from ) for ; Mon, 07 Apr 2025 08:22:26 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Jap5Roy7; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4189B1E0C3; Mon, 7 Apr 2025 08:22:26 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B6DD31E05C for ; Mon, 7 Apr 2025 08:22:25 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 54584384A442 for ; Mon, 7 Apr 2025 12:22:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54584384A442 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1744028545; bh=B7vi+RORJph6KzCs7vITmQK2m/TfcXRa+JCa3BNFuDI=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Jap5Roy7MwYhqAsrF/ogN0LnpYUNQH/HqMmI42jvKhxUD4fYS2IOVeQ6iONbS2J/A dQT2daHCBg/FCUfO6zw3UgxpUr7icpzqjcQeRMy/SNAYLNLZ0pWTPmTWN5U4Ajz/dQ IUAw5hiKRmceV10wpSyQaeW+P+WsnhYvC+KxdJDk= Received: from mail.viric.name (mail.viric.name [37.18.133.75]) by sourceware.org (Postfix) with ESMTPS id 39E79384A4AA for ; Mon, 7 Apr 2025 12:21:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 39E79384A4AA ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 39E79384A4AA ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744028502; cv=none; b=OrueiJnrzISuRjD3CHESCd1zZE1iLhN5K4FYwt8DAUYlkAbLgN+CcEZWcowz1iV13ec5YffZoRpg03gtL/mSvaCnbigtpGnIcnjh5hbEyZqOWKF4c+m/MuDaWFoxkoacExF9uuD0N2+6HOH5Bu35FCGhDey5PuoArfHakNBdLmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744028502; c=relaxed/simple; bh=O4vs1KYp4u1Mad0SPi9BUaIZV7eRHUDWgGUOepzRgoc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=JyT5QlQHHEMcdkkBim2ufJXdY1dKPEoZrTQadF5n1vCWZbAfXpVTjVLM7wInrL0zCHrOOapIZI7VNY04dE2N0MmwgMb9ypXK6BTpTy4kHyjMvOUYUtydfdzQYxL03VSz2+/e7q1rBY8BCzR83lDw4+qVBJklsBomMQ+lwDELVpk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39E79384A4AA Received: by mail.viric.name (Postfix, from userid 1000) id E79D31A8DF48; Mon, 07 Apr 2025 14:21:40 +0200 (CEST) Date: Mon, 7 Apr 2025 14:21:40 +0200 To: Guinevere Larsen Cc: gdb@sourceware.org Subject: Re: Loading some symbols, when, and index-cache Message-ID: X-Accept-Language: ca, es, eo, ru, en, jbo, tokipona References: <6214910b-519f-420f-8999-b05e5410ad5a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6214910b-519f-420f-8999-b05e5410ad5a@redhat.com> X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: =?utf-8?q?Llu=C3=ADs_Batlle_i_Rossell_via_Gdb?= Reply-To: =?utf-8?B?TGx1w61z?= Batlle i Rossell Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" On Mon, Apr 07, 2025 at 09:05:10AM -0300, Guinevere Larsen via Gdb wrote: > $ time ./gdb gdb --batch -ex "complete list def" #Basically the same as you > did > ./gdb gdb --batch -ex "complete list def"  42.40s user 1.19s system 120% cpu > 36.243 total > $ time ./gdb gdb --batch --readnow -ex "complete list def" > ./gdb gdb --batch --readnow -ex "complete list def"  58.32s user 1.79s > system 100% cpu 1:00.08 total > > So even with the slower expansion, GDB is still faster than if we had all > symbols being read at the start, and this isn't even taking into account the > memory usage. There are two points important: The cache should allow having a big file on disk that it's just read into memory with zero work and then all symbols are ready to search. But apparently this happens only with the "minimal" set of symbols, which is far from enough for a tab completion. And 2nd, at gdb ELF file loading, thread workers are launched to read the symbols from the CUs. Again, these seem to load only the "minimal" set of symbols. In your example of 1 minute that load of CUs runs single thread. I can't even tell that the code behaves correctly. One could say that the initial load of CUs multithread should load ALL symbols, and same about caching. Or at least that could be an option. Otherwise, the things they are meant to run faster become quite limited, while the really-slow usual completions go single-thread uncached, taking for you 1 minute. Thanks, Lluís.