monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] speed of "mtn ls branches"


From: William Uther
Subject: Re: [Monotone-devel] speed of "mtn ls branches"
Date: Thu, 17 Jan 2008 19:40:09 +1100


On 17/01/2008, at 5:46 PM, Tony Tung wrote:

Well, I run "ls branches" as part of my shell completion, so 0.2 seconds does seem like an eternity. :) In any case, adding "-- ignore-suspend-certs" does not make any difference.

Hrm, it appears you are correct. The reason seems to be the correctness issue I mentioned at the end of my last email:

Note that there is a subtle bug/design choice here: If the only instance of a revision on a particular branch happens to have an invalid branch cert (i.e. you have no valid branch certs with that branch), then the 'mtn ls branches' code without suspend cert checks (either the old code, or with --ignore-suspend-certs) will return it anyway. The code with suspend cert checks will not return that as a valid branch, even though it isn't suspended.

It appears that the 'ls branches' code is currently _always_ checking that the certs are valid by finding the heads of each branch. To make --ignore-suspend-certs return a quick-and-dirty list rather than the validity-checked list, one could make the following change:

# patch "cmd_list.cc"
#  from [bd12d9df9a26a4fc189681a3a374a211357ab9d2]
#    to [d776611e29b3a5f1b99fb0d67c4a0e12895dfa5d]
#
============================================================
--- cmd_list.cc bd12d9df9a26a4fc189681a3a374a211357ab9d2
+++ cmd_list.cc d776611e29b3a5f1b99fb0d67c4a0e12895dfa5d
@@ -281,7 +281,7 @@ CMD(branches, "branches", "", CMD_REF(li

   globish exc(app.opts.exclude_patterns);
   set<branch_name> names;
-  app.get_project().get_branch_list(inc, names);
+ app.get_project().get_branch_list(inc, names, ! app.opts.ignore_suspend_certs);

   for (set<branch_name>::const_iterator i = names.begin();
        i != names.end(); ++i)

I'm not sure if that should be committed or not. It reduces 'time ls branches --ignore-suspend-certs' on my monotone db from 7s down to less than 0.1s. But it means ignoring the validity of certs in this case.

Thoughts?

Will      :-}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]