perf: tweak tests for testing index performance improvements
authorMatt Mackall <mpm@selenic.com>
Thu, 15 Mar 2012 13:11:03 -0500
changeset 16260 33fcad3cfbbc
parent 16259 589aab2ca716
child 16261 7b9bf72430ba
perf: tweak tests for testing index performance improvements
contrib/perf.py
--- a/contrib/perf.py	Wed Mar 14 01:13:45 2012 +0100
+++ b/contrib/perf.py	Thu Mar 15 13:11:03 2012 -0500
@@ -46,7 +46,7 @@
     timer(lambda: sum(map(len, repo.status())))
 
 def perfheads(ui, repo):
-    timer(lambda: len(repo.changelog.heads()))
+    timer(lambda: len(repo.changelog.headrevs()))
 
 def perftags(ui, repo):
     import mercurial.changelog, mercurial.manifest
@@ -84,8 +84,8 @@
     mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
     n = repo["tip"].node()
     def d():
-        repo.invalidate()
-        repo[n]
+        cl = mercurial.revlog.revlog(repo.sopener, "00changelog.i")
+        cl.rev(n)
     timer(d)
 
 def perfstartup(ui, repo):