This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA 0/5] Improve DWARF Type Unit performance


This patch series is a step to improve gdb's performance with
DWARF4 type units.  In large programs there can be an order of magnitude
or greater more type units than comp units, and gdb's current handling
of them measurably slows down.

My canonical testcase has ~200K TUs and ~8K CUs.

Another example is

There's more I want to do in this area, but this is a good step.
It groups TUs by the DW_AT_stmt_list value they use, which is a natural
way to organize the symbol tables since gdb organizes symbol tables by
file name.

One possible future step is to use the same symtabs that a CU uses for
TUs with the same DW_AT_stmt_list value.  I didn't do this here because
that would be more invasive and I want to approach this incrementally.

Another possible future step is to lazily expand types.
But that's for another day too.

I've regression tested this with/without .debug_types, as well as
with dwz, .gdb_index, and fission.

Here are some timings I've collected.


gdb $program # no .gdb_index
b foo.h:897 #1
d 2
b foo.h:897 #2

#1: 44 seconds (cpu & wall), 2G (additional) memory
#2: 3.3 seconds (cpu & wall), 0 (additional) memory

#1: 9.5 seconds (cpu & wall), 950M (add'l) memory
#2: 0.05 seconds (cpu & wall). 0 (add'l) memory


gdb $program # with .gdb_index v7
rbreak foo.h:Init
[measuring just time taken by search_symbols]

Before: 492sec wall, 11G (add'l) memory, at which point I killed it
After: 187sec wall, ~6G (add'l) memory


gdb $program # with .gdb_index v7
complete break logg

Before: 5.7sec wall, 0 (add'l) memory
After: 0.8sec wall, 0 (add'l) memory


gdb $program # with .gdb_index v7
info fun Task
info sources

info fun Task: 19sec cpu&wall, 300M (add'l) memory
info sources: 66sec cpu, 130 sec wall, 314M (add'l) memory

info fun Task: 7sec cpu&wall, 56M (add'l) memory
info sources: 16sec cpu, 20sec wall, 250M (add'l) memory

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]