contrib/perf.py
changeset 18080 486bfb200b3f
parent 18062 1471f5e83686
child 18091 f7f8159caad3
--- a/contrib/perf.py	Tue Dec 11 14:47:33 2012 -0800
+++ b/contrib/perf.py	Fri Dec 14 10:23:18 2012 -0800
@@ -78,6 +78,15 @@
             pass
     timer(d)
 
+def perfancestorset(ui, repo, revset):
+    revs = repo.revs(revset)
+    heads = repo.changelog.headrevs()
+    def d():
+        s = set(repo.changelog.ancestors(heads))
+        for rev in revs:
+            rev in s
+    timer(d)
+
 def perfdirstate(ui, repo):
     "a" in repo.dirstate
     def d():
@@ -253,6 +262,7 @@
     'perfheads': (perfheads, []),
     'perftags': (perftags, []),
     'perfancestors': (perfancestors, []),
+    'perfancestorset': (perfancestorset, [], "REVSET"),
     'perfdirstate': (perfdirstate, []),
     'perfdirstatedirs': (perfdirstate, []),
     'perfdirstatewrite': (perfdirstatewrite, []),