From: "Hannes Domani via gdb" <gdb@sourceware.org>
To: GDB Development <gdb@sourceware.org>
Subject: Re: question about expand_symtabs_matching()
Date: Fri, 01 Mar 2019 18:51:00 -0000 [thread overview]
Message-ID: <1682009983.12256919.1551466302655@mail.yahoo.com> (raw)
In-Reply-To: <87lg1yh2gx.fsf@tromey.com>
Am Freitag, 1. März 2019, 19:30:56 MEZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben:
> Personally I'd be fine with changing the syntax of the more obscure
> linespecs ("function:label" is probably not used much in practice) in
> order to make the parsing more sane, if it had a performance benefit
> here. But that's just me.
I didn't even know before I started looking into this that function:label
is possible.
> Also, a negative result is still a parse result; so if a linespec
> understood which objfiles had been searched, it could still easily skip
> this work on dlopen or dlclose.
If you mean that it should only search the newly loaded shared library,
then yes, I agree.
> Hannes> Similar, for the case of a simple function name as pending breakpoint,
> Hannes> it's cp_canonicalize_string_no_typedefs() called by find_linespec_symbols(),
> Hannes> that's taking most of the time.
> Hannes> And I'm wondering if this call is necessary if you only use the function name
> Hannes> without arguments (like 'function' or Class::member_function).
>
> I doubt it's needed but on the other hand it may not really save much.
> Maybe one way to do the experiment is check the string for
> non-identifier characters before trying to canonicalize it.
For the case of 'b some_function', with the application I'm testing:
- startup time with the call of cp_canonicalize_string_no_typedefs(): 1m 25s
- startup time without this call: 27s
> Hannes> If you are interested, I could also send you the profiling flamegraphs.
>
> It's an area I'm interested in but I'm not actively working there right
> now. If you're interested at all in gdb development ... on the one hand
> tackling linespec caching is maybe a difficult project, but on the other
> hand it seems fun :-)
In my personal build I've changed this:
- only call cp_canonicalize_string_no_typedefs() if it's not a simple function
name (like 'function_name' or 'Class::member_function')
- only call expand_symtabs_matching() if the lookup_name doesn't contain a '.'
I admit that I don't fully understand what could break with these changes,
but the speedup makes it worth for me right now.
Regards
Hannes Domani
next prev parent reply other threads:[~2019-03-01 18:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <183519794.10360727.1551304006549.ref@mail.yahoo.com>
[not found] ` <183519794.10360727.1551304006549@mail.yahoo.com>
2019-02-27 23:55 ` Tom Tromey
2019-02-28 11:32 ` Hannes Domani via gdb
2019-03-01 18:30 ` Tom Tromey
2019-03-01 18:51 ` Hannes Domani via gdb [this message]
2019-03-08 21:13 ` Tom Tromey
[not found] ` <605876742.3053854.1552089304851@mail.yahoo.com>
2019-03-09 0:18 ` Fw: " Hannes Domani via gdb
[not found] <948301287.10289911.1551297622910.ref@mail.yahoo.com>
2019-02-27 20:02 ` Hannes Domani via gdb
2019-02-27 21:26 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1682009983.12256919.1551466302655@mail.yahoo.com \
--to=gdb@sourceware.org \
--cc=ssbssa@yahoo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox