Re: [RFA 08/15] Remove readin and compunit_symtab fields from psymtab

Tom Tromey
2018-09-28T05:02:06Z

>>>>> "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