.gdb_index prod perf regression: mapped_symtab now vector of values
authorPedro Alves <palves@redhat.com>
Mon, 12 Jun 2017 01:51:52 +0000 (02:51 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 12 Jun 2017 16:06:26 +0000 (17:06 +0100)
commit4b76cda9938e4cb200bccffb6e020268c6a51b89
tree3fad10c03191b5e30596276d95aabd0200659859
parente8f8bcb35f22965c8e4309c4aa4227241c485fe7
.gdb_index prod perf regression: mapped_symtab now vector of values

... instead of vector of pointers

There's no real reason for having mapped_symtab::data be a vector of
heap-allocated symtab_index_entries.  symtab_index_entries is not that
large, it's movable, and it's cheap to move.  Making the vector hold
values instead improves cache locality and eliminates many roundtrips
to the heap.

Using the same test as in the previous patch, against the same gdb
inferior, timing improves ~13% further:

  ~6.0s => ~5.2s (average of 5 runs).

Note that before the .gdb_index C++ifycation patch, we were at ~5.7s.
We're now consistenly better than before.

gdb/ChangeLog
2017-06-12  Pedro Alves  <palves@redhat.com>

* dwarf2read.c (mapped_symtab::data): Now a vector of
symtab_index_entry instead of vector of
std::unique_ptr<symtab_index_entry>.  All users adjusted to check
whether an element's name is NULL instead of checking whether the
element itself is NULL.
(find_slot): Change return type.  Adjust.
(hash_expand, , add_index_entry, uniquify_cu_indices)
(write_hash_table): Adjust.
gdb/ChangeLog
gdb/dwarf2read.c