This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Do not add partial_symbol again and again to the list
- From: Aleksandar Ristovski <aristovski at qnx dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 11 Feb 2008 15:51:59 -0500
- Subject: Re: [patch] Do not add partial_symbol again and again to the list
- References: <47B0AEC7.3070400@qnx.com> <20080211203809.GA29560@caradoc.them.org>
Daniel Jacobowitz wrote:
On Mon, Feb 11, 2008 at 03:23:35PM -0500, Aleksandar Ristovski wrote:
The attached patch checks if partial_symbol has already been added to the
list instead of adding duplicate records.
How does this ever happen? It seems very wrong. Also, I am worried
that the linear search will be a bottleneck (this is quadratic as each
psymtab grows).
Yes, I understand your concern about the complexity... but...
As a reference point, the binary I was mentioning here:
http://sourceware.org/ml/gdb-patches/2008-02/msg00174.html
with 9M+ partial symbols, after the patch it dropped to below 100K partial symbols:
Statistics:
Number of psymtabs : 16659
Number of global symbols : 98286
Number of static symbols : 59275
Number of glob. sym. sorts : 4
Now the sorting is much less costly.
Even easier: eliminate the copy entirely. SYMBOL_SET_NAMES -> symbol_set_names
already does this and it never modifies its argument.
I will take a look.