From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, macro@mips.com
Subject: Re: [RFA 1/2] Make line tables independent of progspace
Date: Wed, 28 Mar 2018 12:32:00 -0000 [thread overview]
Message-ID: <b1ecac72-32f4-7ea1-659f-91cc5c38798a@simark.ca> (raw)
In-Reply-To: <87muysx06b.fsf@tromey.com>
On 2018-03-28 01:02 AM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
>
>>> + auto pc_compare = [=](const CORE_ADDR & pc,
>>> + const struct linetable_entry & lhs)->bool
>>> {
>>> - return pc < lhs.pc;
>>> + return pc < lhs.address (iter_s);
>>> };
>
> Simon> Since we know this will be called many times and address() is substantially
> Simon> more costly than just reading a CORE_ADDR field, maybe it would be good to
> Simon> save it to a variable before and use that in the lambda.
>
> I am not sure this would work, because LHS is what changes here --
> std::upper_bound is searching through the line table looking for a
> match.
>
> One idea might be to "unrelocate" PC to do the search. This would make
> the search more efficient. I will try this.
Ah sorry, you are right.
Simon
next prev parent reply other threads:[~2018-03-28 12:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-21 17:18 [RFA 0/2] " Tom Tromey
2018-03-21 17:18 ` [RFA 1/2] " Tom Tromey
2018-03-24 3:40 ` Simon Marchi
2018-03-27 4:16 ` Tom Tromey
2018-03-27 4:53 ` Tom Tromey
2018-03-27 20:22 ` Simon Marchi
2018-03-28 4:53 ` Tom Tromey
2018-03-28 12:30 ` Simon Marchi
2018-03-28 3:34 ` Simon Marchi
2018-03-28 5:02 ` Tom Tromey
2018-03-28 12:32 ` Simon Marchi [this message]
2018-03-28 19:33 ` Maciej W. Rozycki
2018-03-29 15:04 ` Simon Marchi
2018-03-29 21:07 ` Maciej W. Rozycki
2018-04-26 21:30 ` Tom Tromey
2018-05-03 23:17 ` Maciej W. Rozycki
2018-05-14 23:54 ` Maciej W. Rozycki
2018-03-21 17:18 ` [RFA 2/2] Constify the line table 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=b1ecac72-32f4-7ea1-659f-91cc5c38798a@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=macro@mips.com \
--cc=tom@tromey.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).