##// END OF EJS Templates
perfdiscovery: benching findcommonheads()...
Georges Racinet -
r40977:db6cace1 default
parent child Browse files
Show More
@@ -37,6 +37,7 b' from mercurial import ('
37 37 copies,
38 38 error,
39 39 extensions,
40 hg,
40 41 mdiff,
41 42 merge,
42 43 revlog,
@@ -67,6 +68,11 b' try:'
67 68 from mercurial import scmutil # since 1.9 (or 8b252e826c68)
68 69 except ImportError:
69 70 pass
71 try:
72 from mercurial import setdiscovery # since 1.9 (or cb98fed52495)
73 except ImportError:
74 pass
75
70 76
71 77 def identity(a):
72 78 return a
@@ -581,6 +587,21 b' def perfancestorset(ui, repo, revset, **'
581 587 timer(d)
582 588 fm.end()
583 589
590 @command(b'perfdiscovery', formatteropts, b'PATH')
591 def perfdiscovery(ui, repo, path, **opts):
592 """benchmark discovery between local repo and the peer at given path
593 """
594 repos = [repo, None]
595 timer, fm = gettimer(ui, opts)
596 path = ui.expandpath(path)
597
598 def s():
599 repos[1] = hg.peer(ui, opts, path)
600 def d():
601 setdiscovery.findcommonheads(ui, *repos)
602 timer(d, setup=s)
603 fm.end()
604
584 605 @command(b'perfbookmarks', formatteropts +
585 606 [
586 607 (b'', b'clear-revlogs', False, b'refresh changelog and manifest'),
@@ -79,6 +79,9 b' perfstatus'
79 79 (no help text available)
80 80 perfdirstatewrite
81 81 (no help text available)
82 perfdiscovery
83 benchmark discovery between local repo and the peer at given
84 path
82 85 perffncacheencode
83 86 (no help text available)
84 87 perffncacheload
@@ -206,6 +209,7 b' perfstatus'
206 209 $ hg perfvolatilesets
207 210 $ hg perfwalk
208 211 $ hg perfparents
212 $ hg perfdiscovery -q .
209 213
210 214 test actual output
211 215 ------------------
General Comments 0
You need to be logged in to leave comments. Login now