contrib/perf.py
changeset 18080 486bfb200b3f
parent 18062 1471f5e83686
child 18091 f7f8159caad3
equal deleted inserted replaced
18079:b3ba69692f8a 18080:486bfb200b3f
    76     def d():
    76     def d():
    77         for a in repo.changelog.ancestors(heads):
    77         for a in repo.changelog.ancestors(heads):
    78             pass
    78             pass
    79     timer(d)
    79     timer(d)
    80 
    80 
       
    81 def perfancestorset(ui, repo, revset):
       
    82     revs = repo.revs(revset)
       
    83     heads = repo.changelog.headrevs()
       
    84     def d():
       
    85         s = set(repo.changelog.ancestors(heads))
       
    86         for rev in revs:
       
    87             rev in s
       
    88     timer(d)
       
    89 
    81 def perfdirstate(ui, repo):
    90 def perfdirstate(ui, repo):
    82     "a" in repo.dirstate
    91     "a" in repo.dirstate
    83     def d():
    92     def d():
    84         repo.dirstate.invalidate()
    93         repo.dirstate.invalidate()
    85         "a" in repo.dirstate
    94         "a" in repo.dirstate
   251     'perfchangeset': (perfchangeset, []),
   260     'perfchangeset': (perfchangeset, []),
   252     'perfindex': (perfindex, []),
   261     'perfindex': (perfindex, []),
   253     'perfheads': (perfheads, []),
   262     'perfheads': (perfheads, []),
   254     'perftags': (perftags, []),
   263     'perftags': (perftags, []),
   255     'perfancestors': (perfancestors, []),
   264     'perfancestors': (perfancestors, []),
       
   265     'perfancestorset': (perfancestorset, [], "REVSET"),
   256     'perfdirstate': (perfdirstate, []),
   266     'perfdirstate': (perfdirstate, []),
   257     'perfdirstatedirs': (perfdirstate, []),
   267     'perfdirstatedirs': (perfdirstate, []),
   258     'perfdirstatewrite': (perfdirstatewrite, []),
   268     'perfdirstatewrite': (perfdirstatewrite, []),
   259     'perflog': (perflog,
   269     'perflog': (perflog,
   260                 [('', 'rename', False, 'ask log to follow renames')]),
   270                 [('', 'rename', False, 'ask log to follow renames')]),