Patchwork [1,of,9] perf: unroll the result in perfrevset

mail settings
Submitter Pierre-Yves David
Date March 27, 2014, 2:49 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/4080/
State Accepted
Commit b581c5827516ac14fb30c2ca1df9a4b153fac919
Headers show


Pierre-Yves David - March 27, 2014, 2:49 a.m.
# 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/ b/contrib/
--- a/contrib/
+++ b/contrib/
@@ -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.revs(expr)
+        for r in repo.revs(expr): pass
 def perfvolatilesets(ui, repo, *names):
     """benchmark the computation of various volatile set