changeset 27308:7bc52ac46172

perf: perfrevlog optimize for perf.stub
author timeless <timeless@mozdev.org>
date Fri, 04 Dec 2015 19:05:56 +0000
parents f36dc0062b1a
children b0de270acd17
files contrib/perf.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Fri Dec 04 19:05:32 2015 +0000
+++ b/contrib/perf.py	Fri Dec 04 19:05:56 2015 +0000
@@ -476,9 +476,10 @@
     timer, fm = gettimer(ui, opts)
     from mercurial import revlog
     dist = opts['dist']
+    _len = getlen(ui)
     def d():
         r = revlog.revlog(lambda fn: open(fn, 'rb'), file_)
-        for x in xrange(0, len(r), dist):
+        for x in xrange(0, _len(r), dist):
             r.revision(r.node(x))
 
     timer(d)