Parallelize DWARF indexing
authorTom Tromey <tom@tromey.com>
Sun, 18 Apr 2021 21:20:43 +0000 (15:20 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 12 Apr 2022 15:31:16 +0000 (09:31 -0600)
commit46114cb7be362cae03025d65f1b3bcbb1c7e8df0
tree5a76b89039171409089e8d7cdf5206019cb9404c
parentc748b24c47d2f94d2282ffa31d7484a732c18cfd
Parallelize DWARF indexing

This parallelizes the new DWARF indexer.  The indexer's storage was
designed so that each storage object and each indexer is fully
independent.  This setup makes it simple to scan different CUs
independently.

This patch creates a new cooked index storage object per thread, and
then scans a subset of all the CUs in each such thread, using gdb's
existing thread pool.

In the ongoing "gdb gdb" example, this patch reduces the wall time
down to 0.668923, from 0.903534.  (Note that the 0.903534 is the time
for the new index -- that is, when the "enable the new index" patch is
rebased to before this one.  However, in the final series, that patch
appears toward the end.  Hopefully this isn't too confusing.)
gdb/dwarf2/cooked-index.c
gdb/dwarf2/cooked-index.h
gdb/dwarf2/read.c
gdb/dwarf2/read.h