Re: Two observations using GDB 13 snapshot

Eli Zaretskii via Gdb-patches
2022-12-27T18:01:10Z

> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org,
> luis.machado@arm.com
> Date: Tue, 27 Dec 2022 10:19:24 -0700
>
> Eli> All I'm interested in is to help you and others understand what could
> Eli> be the reason for slow reading of debug info at startup, so that it
> Eli> could be sped up at some point.
>
> Ok. I re-read the thread and I see that at the beginning you didn't
> mention -readnow. So, assuming that the -readnow stuff was a
> distraction...

Right. When it was brought up, I thought -readnow was indicative of
what I see, but then you said it doesn't use the new DWARF reader
code, so it is not relevant.

> The new indexer should not be significantly slower even when
> single-threaded. On my machine, if I "maint set worker-threads 0" and
> then use a -O2 build of gdb, it's about as fast as the system /bin/gdb
> (which uses the old code).
>
> Old:
>
> (gdb) file ./gdb
> [...]
> Command execution time: 2.408843 (cpu), 2.130013 (wall)
>
> New:
>
> (gdb) file ./gdb
> [...]
> Command execution time: 2.858222 (cpu), 2.865426 (wall)
>
> This is only slightly worse.

My numbers are very different:

. with GDB-12.1: elapsed: 8.39 sec, CPU: 6.25 sec
. with gdb-13.0.50.20221217-git: elapsed: 135.8 sec, CPU: 130.5 sec

No significant difference in memory consumption: 453MB for GDB 12.1,
441MB for GDB 13.

(Interestingly, when reading symbols from Emacs on the same system,
the times are almost identical: 2.593 for GDB 12 vs 2.671 for GDB 13.)

Other details which might be important:

GCC 9.2.0
Binutils 2.39
GDB compilation switches: -O2 -gdwarf-4 -g3

And one more thing: this is a native 32-bit Windows build of GDB, so
it has DWARF2 info in PE-COFF file, not in ELF. Maybe this could
explain the difference? Or maybe the C++ code is a factor?

Thanks.