From patchwork Thu Mar 27 02:49:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,9] perf: unroll the result in perfrevset From: Pierre-Yves David X-Patchwork-Id: 4080 Message-Id: To: mercurial-devel@selenic.com Cc: pierre-yves.david@ens-lyon.org Date: Wed, 26 Mar 2014 19:49:02 -0700 # HG changeset patch # User Pierre-Yves David # Date 1395879911 25200 # Wed Mar 26 17:25:11 2014 -0700 # Node ID d7da7e3d580cf0239b4fdf012a2647c93a2ee1d9 # Parent 5d859e949ce867db1439448f6ea2bb3745252768 perf: unroll the result in perfrevset With the new lazy revset implementation, we need to actually read all elements to trigger all the computations. Otherwise a no-op if of course much faster than the full work. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -333,11 +333,11 @@ def perfrevset(ui, repo, expr, clear=Fal revisions set cache on the revset execution. Volatile cache hold filtered and obsolete related cache.""" def d(): if clear: repo.invalidatevolatilesets() - repo.revs(expr) + for r in repo.revs(expr): pass timer(d) @command('perfvolatilesets') def perfvolatilesets(ui, repo, *names): """benchmark the computation of various volatile set