# HG changeset patch # User Bryan O'Sullivan # Date 1338591022 25200 # Node ID fdf99e0f60f36009d925da71088c73ab302725dd # Parent 1415edd88c5601d5f85ef94b09c36df2577a9561 perf: add a benchmark for revrange diff -r 1415edd88c56 -r fdf99e0f60f3 contrib/perf.py --- a/contrib/perf.py Mon Jun 04 21:40:38 2012 +0200 +++ b/contrib/perf.py Fri Jun 01 15:50:22 2012 -0700 @@ -140,6 +140,10 @@ def perflookup(ui, repo, rev): timer(lambda: len(repo.lookup(rev))) +def perfrevrange(ui, repo, *specs): + revrange = scmutil.revrange + timer(lambda: len(revrange(repo, specs))) + def perfnodelookup(ui, repo, rev): import mercurial.revlog mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg @@ -223,6 +227,7 @@ 'perffncacheload': (perffncacheload, []), 'perffncachewrite': (perffncachewrite, []), 'perflookup': (perflookup, []), + 'perfrevrange': (perfrevrange, []), 'perfnodelookup': (perfnodelookup, []), 'perfparents': (perfparents, []), 'perfstartup': (perfstartup, []),