[PATCH 2 of 2 V2] revset: add only() fastpath for minus operations

Martin von Zweigbergk martinvonz at google.com
Sat Feb 20 02:46:39 EST 2016


On Thu, Feb 18, 2016 at 11:38 AM, Durham Goode <durham at fb.com> wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1455823717 28800
> #      Thu Feb 18 11:28:37 2016 -0800
> # Node ID a2a62c7df76324d49046a2893c971195507ee64b
> # Parent  dc8d72c3df7dfcd7b67fa71d679cc7c3ad90f25c
> revset: add only() fastpath for minus operations
>
> Previously, '::X - ::Y' was translated to '::X and not ::Y' and the 'and'
> optimizer turned this into 'only(X, Y)'. Since we no longer transform minus into
> and-not we lost this optimization.
>
> This patch adds it back. This results in no performance change actually (as
> determined by revsetbenchmark.py)

Any idea why? IIUC, that means that smartset's minus operator is as
fast as the specialized only() predicate on the tests we have. Does
that mean that we are just missing some relevant tests? Or that only()
is not yet optimized as well as it could be? Or, if the minus operator
really is as fast, that we should optimize and simplify the only()
predicate by calling to the minus operator?


More information about the Mercurial-devel mailing list