[llvm] [DWARF] Speedup .gdb_index dumping (PR #151806)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 05:50:42 PDT 2025


itrofimow wrote:

Thanks for the review!

----

> Hmm, actually at a high level: I guess this ConstantPoolVectors isn't sorted, is it? So we can't do a binary search... could we sort it? I guess not - since we do want to dump it in a way that matches the input too (in case the on-disk ordering is important to debugging the data at some point)?

I think it is sorted by construction, but given that we look for exact match, for big enough vectors it likely would still be faster to put offset->id in a hash map rather than do a binary search.

> oh, and high level question, if you're interested/able: What's your interest in gdb_index?

Actually, I'm not particularly interested in gdb_index itself, although it's always nice to learn how smart people organize their data; I've encountered this inefficiency when debugging BOLT generating gdb-index in ways that break gdb (https://github.com/llvm/llvm-project/issues/151857, https://github.com/llvm/llvm-project/issues/151861).

We at Yandex are also dealing with somewhat large binaries, and even though our toolchain is mostly llvm, gdb is the go-to debugger for probably historical reasons, and there is a lot of infrastructure built on top of it here and there (coredump analysis, some custom poor man's profilers, pretty-printers etc.). At [Perforator](https://github.com/yandex/perforator) we are working to fully support generating BOLT-profiles, and thereafter incorporate BOLT into release pipelines; these BOLT issues manifested themselves, and I went digging

> Myself, I've worked on various indexing solutions at Google due to the large size of single binaries we have

Although I'm not particularly interested in gdb_index, I am very much interested into another index format: GSYM. Given your vast experience with different indexes, maybe you know places/folks to ask questions/request reviews about it?


https://github.com/llvm/llvm-project/pull/151806


More information about the llvm-commits mailing list