This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/patch] Sort global symbols in psymtabs only if needed


On Mon, Feb 11, 2008 at 11:19:46AM -0500, Aleksandar Ristovski wrote:
> The attached patch sorts on first lookup instead of on load.

Does this help if you benchmark any non-trivial debug sessions?
You've sped up startup, but the first call to lookup_symbol is going
to search a large number of such psymtabs.

Also, you probably know this, but be careful using gprof for this sort
of thing.  I recommend oprofile.  gprof artificially inflates the cost
of small frequent functions like strcmp_iw_ordered, because of all the
overhead.

The patch may still be a good idea.  Can we eliminate the binary
search / sort entirely?  We do hash table lookups for full symtabs;
that should be faster than sorting.  See dict_create_hashed.

Those are all hardwired to "struct symbol" at the moment.  But
I think it only uses SYMBOL_SEARCH_NAME, so it could work with
psymbols too if we passed the ginfo around.


-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]