revset-only: use `subset &` instead of filtering
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 10 Oct 2014 17:28:18 -0700
changeset 23004 30b602b2c340
parent 23003 62d19ce9d7b6
child 23005 9bfe68357c01
revset-only: use `subset &` instead of filtering The & version is more likely to be optimised. only(.) before) wall 0.003216 comb 0.000000 user 0.000000 sys 0.000000 (best of 768) after) wall 0.001086 comb 0.000000 user 0.000000 sys 0.000000 (best of 2231) only(default, stable) before) wall 0.018469 comb 0.020000 user 0.020000 sys 0.000000 (best of 138) after) wall 0.015888 comb 0.010000 user 0.010000 sys 0.000000 (best of 156)
mercurial/revset.py
--- a/mercurial/revset.py	Tue Sep 30 15:03:54 2014 -0500
+++ b/mercurial/revset.py	Fri Oct 10 17:28:18 2014 -0700
@@ -408,7 +408,7 @@
         exclude = getset(repo, spanset(repo), args[1])
 
     results = set(ancestormod.missingancestors(include, exclude, cl.parentrevs))
-    return filteredset(subset, results.__contains__)
+    return subset & results
 
 def bisect(repo, subset, x):
     """``bisect(string)``