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: [RFA] massively speed up "info var foo" on large programs


On Thu, May 24, 2012 at 2:28 PM, Doug Evans <dje@google.com> wrote:
> On Thu, May 24, 2012 at 10:58 AM, Doug Evans <dje@google.com> wrote:
>> Hi.
>>
>> I'm not entirely sure this patch is correct, but it feels correct (*1),
>> and is a massive win.
>> "info var Task" in one large program goes from 350 seconds to 28 seconds.

FWIW i don't have anything with enough objfiles for the above to matter,
but here's something that can apply on top of your patch which
helps somewhat for objfiles with lots of symtabs, it still contains
the same worst case,
but helps in the 'info var' case with no arguments in e.g. ./gdb ./gdb
-batch -ex 'info var' case
where there is a lot of symtabs per objfile, and many symbols returned
by info var.

it could be faster if we had a way to know if a msymbol has no symbol
associated with it,
but this was as good as I could get without any major refactoring,
though maybe it is a little too ad-hoc.

anyhow if you don't mind having a look/testing it out.

it does come with a change of behaviour (IMO bugfix)
in that it compares the symbol/msymbol addresses,
this is for the case of ambiguous variable names, where previously it
would not output a msymbol if it found a symbol of the same name.

anyhow it speeds up the aforementioned ./gdb ./gdb -batch -ex 'info
var' case a bit.
though i doubt it will affect 'info var foo' much if at all.

thanks

Attachment: foo.diff
Description: Binary data


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