From patchwork Fri Oct 17 17:49:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5,of,5] revset-matching: call `getset` on a `fullreposet` From: Pierre-Yves David X-Patchwork-Id: 6376 Message-Id: <427727cdc4c2d6f06c2e.1413568171@marginatus.alto.octopoid.net> To: mercurial-devel@selenic.com Cc: Pierre-Yves David Date: Fri, 17 Oct 2014 10:49:31 -0700 # HG changeset patch # User Pierre-Yves David # Date 1413526535 25200 # Thu Oct 16 23:15:35 2014 -0700 # Node ID 427727cdc4c2d6f06c2ef6d7a336658a69b6d7ee # Parent 954383f603744d8408a0c5118a25335b88aa8773 revset-matching: call `getset` on a `fullreposet` Calling `baseset(repo.changelog)` build a list for all revisions in the repo. And we already have the lazy and efficient `fullreposet` class for this purpose. This gives us the usual benefits of the fullreposet but it is less visible because the matching process itself is very expensive: revset) matching(100) before) wall 6.413281 comb 6.420000 user 5.910000 sys 0.510000 (best of 3) after) wall 6.173608 comb 6.170000 user 5.750000 sys 0.420000 (best of 3) However for some complex list, this provide a massive speedup revset) matching(parents(100)) before) wall 23.890740 comb 23.890000 user 23.450000 sys 0.440000 (best of 3) after) wall 6.382280 comb 6.390000 user 5.930000 sys 0.460000 (best of 3) diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1379,11 +1379,11 @@ def matching(repo, subset, x): specified. You can match more than one field at a time. """ # i18n: "matching" is a keyword l = getargs(x, 1, 2, _("matching takes 1 or 2 arguments")) - revs = getset(repo, baseset(repo.changelog), l[0]) + revs = getset(repo, fullreposet(repo), l[0]) fieldlist = ['metadata'] if len(l) > 1: fieldlist = getstring(l[1], # i18n: "matching" is a keyword