This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 08/15] Remove readin and compunit_symtab fields from psymtab
- From: Tom Tromey <tom at tromey dot com>
- To: Simon Marchi <simark at simark dot ca>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Thu, 27 Sep 2018 23:01:38 -0600
- Subject: Re: [RFA 08/15] Remove readin and compunit_symtab fields from psymtab
- References: <20180510222357.27332-1-tom@tromey.com> <20180510222357.27332-9-tom@tromey.com> <5f8f38c4-8b4b-9fea-b9f2-7c69758a09c2@simark.ca>
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
Simon> As Pedro pointed out a few times, unordered_map is an hash map with open
Simon> hashing. So we change what was previously a single pointer dereference
Simon> to a lookup in a hash table, followed with a linear search in a linked
Simon> list. If this map is looked up very frequently, maybe we should consider
Simon> using an htab_t instead? Some profiling data would help, but it seems
Simon> like psymtab_read_in_p is called quite a bit when looking up symbols...
I went ahead and switched this to an htab_t.
I considered, a little, porting over the GCC C++ hash table.
I wasn't sure where to put it, though. I suppose we'd need a new
library. Also, the GCC one has some GCC-isms (the GC stuff), plus the
unusual "empty" method Pedro has mentioned here before.
I still haven't tried any performance measurements.
I'm not quite sure what to try.
If it performs poorly, maybe a single element cache would help.
Also I should probably look to see if there are any spots that iterate
over psymtabs that could be changed to iterate over the map directly.
I'm sort of considering dropping just this one patch and trying to get
the rest in.
Tom