contrib/perf.py
changeset 40783 e207f0d6c243
parent 40772 5cbb74999040
child 40784 a0f2641ddd61
--- a/contrib/perf.py	Sun Dec 02 13:09:46 2018 -0800
+++ b/contrib/perf.py	Fri Nov 23 06:03:38 2018 +0100
@@ -999,11 +999,18 @@
     timer, fm = gettimer(ui, opts)
     mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
     n = repo[b"tip"].node()
-    svfs = getsvfs(repo)
+
+    unfi = repo.unfiltered()
+    # find the filecache func directly
+    # This avoid polluting the benchmark with the filecache logic
+    makecl = unfi.__class__.changelog.func
+    def setup():
+        # probably not necessary, but for good measure
+        clearchangelog(unfi)
     def d():
-        cl = mercurial.revlog.revlog(svfs, b"00changelog.i")
+        cl = makecl(unfi)
         cl.rev(n)
-    timer(d)
+    timer(d, setup=setup)
     fm.end()
 
 @command(b'perfstartup', formatteropts)