[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] speed of "mtn ls branches"
From: |
Zack Weinberg |
Subject: |
Re: [Monotone-devel] speed of "mtn ls branches" |
Date: |
Thu, 17 Jan 2008 16:59:05 -0500 |
On Jan 17, 2008 4:23 PM, William Uther
<address@hidden> wrote:
> On 18/01/2008, at 4:15 AM, Zack Weinberg wrote:
> > update.cc, function calculate_update_set:
> >
> > ...
> > bool have_non_suspended_rev = false;
> >
> > for (set<revision_id>::const_iterator it = candidates.begin(); it !=
> > candidates.end(); it++)
> > {
> > if (!app.get_project().revision_is_suspended_in_branch(*it,
> > branch))
> > {
> > have_non_suspended_rev = true;
> > break;
> > }
> > }
> > if (!app.opts.ignore_suspend_certs && have_non_suspended_rev)
> > {
> > // remove all suspended revisions
> > base64<cert_value> branch_encoded;
> > encode_base64(cert_value(branch()), branch_encoded);
> > suspended_in_branch s(app, branch_encoded);
> > for(std::set<revision_id>::iterator it = candidates.begin(); it
> > != candidates.end(); it++)
> > if (s(*it))
> > candidates.erase(*it);
> > }
>
> Yes, that is repeating some work. Here is the intention:
>
> If there are any non-suspended update candidates then remove the
> suspended
> update candidates, otherwise leave all the suspended revs in the
> candidate
> set.
Couldn't you do that like this? (note: the code under discussion is
the last thing in the function, and "candidates" is its out-argument).
if (app.opts.ignore_suspend_certs)
return;
set<revision_id> active_candidates;
for (set<revision_id>::const_iterator i = candidates.begin();
i != candidates.end(); i++)
if (!app.get_project().revision_is_suspended_in_branch(*i, branch))
active_candidates.push_back(*i);
if (!active_candidates.empty())
{
// maybe we could just do "candidates = active_candidates;" here?
candidates.clear();
std::copy(active_candidates.begin(), active_candidates.end(),
candidates);
}
> How large are the candidate update sets?
> How slow are cert checks?
I don't know about the update sets, but checking certs involves
cryptography, which is slow.
zw
Re: [Monotone-devel] speed of "mtn ls branches", Tony Tung, 2008/01/17
- Re: [Monotone-devel] speed of "mtn ls branches", William Uther, 2008/01/17
- Re: [Monotone-devel] speed of "mtn ls branches", Richard Levitte, 2008/01/17
- Re: [Monotone-devel] speed of "mtn ls branches", William Uther, 2008/01/17
- Re: [Monotone-devel] speed of "mtn ls branches", Daniel Carosone, 2008/01/17
- Re: [Monotone-devel] speed of "mtn ls branches", William Uther, 2008/01/17
- [Monotone-devel] Re: speed of "mtn ls branches", Lapo Luchini, 2008/01/18
- Re: [Monotone-devel] Re: speed of "mtn ls branches", Zack Weinberg, 2008/01/18
- Re: [Monotone-devel] speed of "mtn ls branches", Lapo Luchini, 2008/01/18