##// 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 fm.end()
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 def perfdirstate(ui, repo, **opts):
1108 def perfdirstate(ui, repo, **opts):
1106 """benchmap the time necessary to load a dirstate from scratch
1109 """benchmap the time of various distate operations
1107
1110
1111 By default benchmark the time necessary to load a dirstate from scratch.
1108 The dirstate is loaded to the point were a "contains" request can be
1112 The dirstate is loaded to the point were a "contains" request can be
1109 answered.
1113 answered.
1110 """
1114 """
@@ -1112,11 +1116,18 b' def perfdirstate(ui, repo, **opts):'
1112 timer, fm = gettimer(ui, opts)
1116 timer, fm = gettimer(ui, opts)
1113 b"a" in repo.dirstate
1117 b"a" in repo.dirstate
1114
1118
1115 def setup():
1119 if opts[b'iteration']:
1116 repo.dirstate.invalidate()
1120 setup = None
1117
1121 dirstate = repo.dirstate
1118 def d():
1122 def d():
1119 b"a" in repo.dirstate
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 timer(d, setup=setup)
1132 timer(d, setup=setup)
1122 fm.end()
1133 fm.end()
@@ -107,7 +107,7 b' perfstatus'
107 perfdirfoldmap
107 perfdirfoldmap
108 benchmap a 'dirstate._map.dirfoldmap.get()' request
108 benchmap a 'dirstate._map.dirfoldmap.get()' request
109 perfdirs (no help text available)
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 perfdirstatedirs
111 perfdirstatedirs
112 benchmap a 'dirstate.hasdir' call from an empty 'dirs' cache
112 benchmap a 'dirstate.hasdir' call from an empty 'dirs' cache
113 perfdirstatefoldmap
113 perfdirstatefoldmap
@@ -205,6 +205,7 b' perfstatus'
205 $ hg perfdirfoldmap
205 $ hg perfdirfoldmap
206 $ hg perfdirs
206 $ hg perfdirs
207 $ hg perfdirstate
207 $ hg perfdirstate
208 $ hg perfdirstate --iteration
208 $ hg perfdirstatedirs
209 $ hg perfdirstatedirs
209 $ hg perfdirstatefoldmap
210 $ hg perfdirstatefoldmap
210 $ hg perfdirstatewrite
211 $ hg perfdirstatewrite
General Comments 0
You need to be logged in to leave comments. Login now