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

Durham Goode durham at fb.com
Tue Feb 23 15:32:11 EST 2016






On 2/19/16, 11:46 PM, "Martin von Zweigbergk" <martinvonz at google.com> wrote:

>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?

I think the minus operator is just generally fast enough in these cases.  Further investigation might show we don't need to special case only(), but only() is a pretty unique variant that we probably want to keep so we can add further optimizations later.


More information about the Mercurial-devel mailing list