contrib/perf.py
changeset 40700 30f443d34a7d
parent 40699 94d76ddac40a
child 40701 e4ea63855d5a
equal deleted inserted replaced
40699:94d76ddac40a 40700:30f443d34a7d
  2245     # try once without timer, the filter may not be cached
  2245     # try once without timer, the filter may not be cached
  2246     if branchmap.read(repo) is None:
  2246     if branchmap.read(repo) is None:
  2247         raise error.Abort(b'No branchmap cached for %s repo'
  2247         raise error.Abort(b'No branchmap cached for %s repo'
  2248                           % (filter or b'unfiltered'))
  2248                           % (filter or b'unfiltered'))
  2249     timer, fm = gettimer(ui, opts)
  2249     timer, fm = gettimer(ui, opts)
  2250     timer(lambda: branchmap.read(repo) and None)
  2250     def bench():
       
  2251         branchmap.read(repo)
       
  2252     timer(bench)
  2251     fm.end()
  2253     fm.end()
  2252 
  2254 
  2253 @command(b'perfloadmarkers')
  2255 @command(b'perfloadmarkers')
  2254 def perfloadmarkers(ui, repo):
  2256 def perfloadmarkers(ui, repo):
  2255     """benchmark the time to parse the on-disk markers for a repo
  2257     """benchmark the time to parse the on-disk markers for a repo