comparison contrib/perf.py @ 24349:389693a245fa

perf: add methods for timing changeset file list reading
author Matt Mackall <mpm@selenic.com>
date Wed, 18 Mar 2015 12:03:44 -0500
parents 37a92908a382
children f5b527024fcc
comparison
equal deleted inserted replaced
24348:b7f936f47f2b 24349:389693a245fa
288 timer, fm = gettimer(ui) 288 timer, fm = gettimer(ui)
289 nl = [repo.changelog.node(i) for i in xrange(1000)] 289 nl = [repo.changelog.node(i) for i in xrange(1000)]
290 def d(): 290 def d():
291 for n in nl: 291 for n in nl:
292 repo.changelog.parents(n) 292 repo.changelog.parents(n)
293 timer(d)
294 fm.end()
295
296 @command('perfctxfiles')
297 def perfparents(ui, repo, x):
298 x = int(x)
299 timer, fm = gettimer(ui)
300 def d():
301 len(repo[x].files())
302 timer(d)
303 fm.end()
304
305 @command('perfrawfiles')
306 def perfparents(ui, repo, x):
307 x = int(x)
308 timer, fm = gettimer(ui)
309 cl = repo.changelog
310 def d():
311 len(cl.read(x)[3])
293 timer(d) 312 timer(d)
294 fm.end() 313 fm.end()
295 314
296 @command('perflookup') 315 @command('perflookup')
297 def perflookup(ui, repo, rev): 316 def perflookup(ui, repo, rev):