From: "Lluís Batlle i Rossell via Gdb" <gdb@sourceware.org>
To: Guinevere Larsen <guinevere@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: Loading some symbols, when, and index-cache
Date: Mon, 7 Apr 2025 14:21:40 +0200 [thread overview]
Message-ID: <zevoy4ps2torxbkvcik6vahtx4pxkdypsd3hhne47xgtiaqbm7@a3nojsauzd5q> (raw)
In-Reply-To: <6214910b-519f-420f-8999-b05e5410ad5a@redhat.com>
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.
next prev parent reply other threads:[~2025-04-07 12:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-06 15:07 Lluís Batlle i Rossell via Gdb
2025-04-07 12:05 ` Guinevere Larsen via Gdb
2025-04-07 12:21 ` Lluís Batlle i Rossell via Gdb [this message]
2025-04-07 16:01 ` Simon Marchi via Gdb
2025-04-08 7:29 ` Lluís Batlle i Rossell via Gdb
2025-04-08 13:43 ` Simon Marchi via Gdb
2025-04-09 7:42 ` Lluís Batlle i Rossell via Gdb
2025-04-22 15:31 ` Simon Marchi via Gdb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=zevoy4ps2torxbkvcik6vahtx4pxkdypsd3hhne47xgtiaqbm7@a3nojsauzd5q \
--to=gdb@sourceware.org \
--cc=guinevere@redhat.com \
--cc=viric@viric.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox