##// END OF EJS Templates
perf: introduce a `--iteration` to `perfdirstate`...
marmoute -
r43466:5f9b1250 default
parent child Browse files
Show More
@@ -1101,10 +1101,14 b' def perfdirs(ui, repo, **opts):'
1101 1101 fm.end()
1102 1102
1103 1103
1104 @command(b'perfdirstate', formatteropts)
1104 @command(b'perfdirstate', [
1105 (b'', b'iteration', None,
1106 b'benchmark a full iteration for the dirstate'),
1107 ] + formatteropts)
1105 1108 def perfdirstate(ui, repo, **opts):
1106 """benchmap the time necessary to load a dirstate from scratch
1107
1109 """benchmap the time of various distate operations
1110
1111 By default benchmark the time necessary to load a dirstate from scratch.
1108 1112 The dirstate is loaded to the point were a "contains" request can be
1109 1113 answered.
1110 1114 """
@@ -1112,11 +1116,18 b' def perfdirstate(ui, repo, **opts):'
1112 1116 timer, fm = gettimer(ui, opts)
1113 1117 b"a" in repo.dirstate
1114 1118
1115 def setup():
1116 repo.dirstate.invalidate()
1117
1118 def d():
1119 b"a" in repo.dirstate
1119 if opts[b'iteration']:
1120 setup = None
1121 dirstate = repo.dirstate
1122 def d():
1123 for f in dirstate:
1124 pass
1125 else:
1126 def setup():
1127 repo.dirstate.invalidate()
1128
1129 def d():
1130 b"a" in repo.dirstate
1120 1131
1121 1132 timer(d, setup=setup)
1122 1133 fm.end()
@@ -107,7 +107,7 b' perfstatus'
107 107 perfdirfoldmap
108 108 benchmap a 'dirstate._map.dirfoldmap.get()' request
109 109 perfdirs (no help text available)
110 perfdirstate benchmap the time necessary to load a dirstate from scratch
110 perfdirstate benchmap the time of various distate operations
111 111 perfdirstatedirs
112 112 benchmap a 'dirstate.hasdir' call from an empty 'dirs' cache
113 113 perfdirstatefoldmap
@@ -205,6 +205,7 b' perfstatus'
205 205 $ hg perfdirfoldmap
206 206 $ hg perfdirs
207 207 $ hg perfdirstate
208 $ hg perfdirstate --iteration
208 209 $ hg perfdirstatedirs
209 210 $ hg perfdirstatefoldmap
210 211 $ hg perfdirstatewrite
General Comments 0
You need to be logged in to leave comments. Login now