##// 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 copies,
37 copies,
38 error,
38 error,
39 extensions,
39 extensions,
40 hg,
40 mdiff,
41 mdiff,
41 merge,
42 merge,
42 revlog,
43 revlog,
@@ -67,6 +68,11 b' try:'
67 from mercurial import scmutil # since 1.9 (or 8b252e826c68)
68 from mercurial import scmutil # since 1.9 (or 8b252e826c68)
68 except ImportError:
69 except ImportError:
69 pass
70 pass
71 try:
72 from mercurial import setdiscovery # since 1.9 (or cb98fed52495)
73 except ImportError:
74 pass
75
70
76
71 def identity(a):
77 def identity(a):
72 return a
78 return a
@@ -581,6 +587,21 b' def perfancestorset(ui, repo, revset, **'
581 timer(d)
587 timer(d)
582 fm.end()
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 @command(b'perfbookmarks', formatteropts +
605 @command(b'perfbookmarks', formatteropts +
585 [
606 [
586 (b'', b'clear-revlogs', False, b'refresh changelog and manifest'),
607 (b'', b'clear-revlogs', False, b'refresh changelog and manifest'),
@@ -79,6 +79,9 b' perfstatus'
79 (no help text available)
79 (no help text available)
80 perfdirstatewrite
80 perfdirstatewrite
81 (no help text available)
81 (no help text available)
82 perfdiscovery
83 benchmark discovery between local repo and the peer at given
84 path
82 perffncacheencode
85 perffncacheencode
83 (no help text available)
86 (no help text available)
84 perffncacheload
87 perffncacheload
@@ -206,6 +209,7 b' perfstatus'
206 $ hg perfvolatilesets
209 $ hg perfvolatilesets
207 $ hg perfwalk
210 $ hg perfwalk
208 $ hg perfparents
211 $ hg perfparents
212 $ hg perfdiscovery -q .
209
213
210 test actual output
214 test actual output
211 ------------------
215 ------------------
General Comments 0
You need to be logged in to leave comments. Login now