Patchwork [6,of,8] contrib/perf: perfrevlog optimize for perf.stub

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 8, 2015, 7:07 a.m.
Message ID <de3bce18f371461fa8e5.1449558447@waste.org>
Download mbox | patch
Permalink /patch/11929/
State Accepted
Headers show

Comments

timeless@mozdev.org - Dec. 8, 2015, 7:07 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1449255956 0
#      Fri Dec 04 19:05:56 2015 +0000
# Node ID de3bce18f371461fa8e59949591becf7decdc2b9
# Parent  8e92b61c81221b2dbfd351745e8c60e8ffca38f3
contrib/perf: perfrevlog optimize for perf.stub

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -475,9 +475,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)