Apparently the moral of this little story is that although in theory the
dyadic (and also the monadic) forms  u @: v~  and  u @: (v~)  are
equivalent, in practice (performance-wise) they might not.  In some
instances  u @: v~  might trigger special code whereas  u @: (v~)  would
not.  It seems that it is no accident that  u @:v~  also happens to be the
simpler form.


On Wed, Jan 20, 2016 at 6:57 PM, Henry Rich <[email protected]> wrote:

> Right.
>
> Henry Rich
>
>
> On 1/20/2016 6:55 PM, Jose Mario Quintana wrote:
>
>> Thanks for your feedback; that is reassuring to me.  This is a more
>> comprehensive comparison:
>>
>>      assert X (2 -:/\ (([: <. %)~) ; ([: <. %~) ; (<.@%~) ; (<.@(%~)) ;
>> (<.@:%~) ; (<.@:(%~))) Y
>>
>>     11 stp noun define
>> X (([: <.  %)~)  Y
>> X ( [: <.  % ~)  Y
>> X (    <.@ % ~)  Y
>> X (    <.@(% ~)) Y
>> X (    <.@:% ~)  Y
>> X (    <.@:(%~)) Y
>> )
>> ┌──────────────────┬───────┬─────────────┬──────────┐
>> │Sentence          │Space  │Time         │Product   │
>> ├──────────────────┼───────┼─────────────┼──────────┤
>> │X (([: <.  %)~)  Y│8797184│0.0285709797 │251344.165│
>> ├──────────────────┼───────┼─────────────┼──────────┤
>> │X ( [: <.  % ~)  Y│8797184│0.0268573186 │236268.774│
>> ├──────────────────┼───────┼─────────────┼──────────┤
>> │X (    <.@ % ~)  Y│4219392│0.00446664877│18846.5421│
>> ├──────────────────┼───────┼─────────────┼──────────┤
>> │X (    <.@(% ~)) Y│8797184│0.0247148887 │217421.423│
>> ├──────────────────┼───────┼─────────────┼──────────┤
>> │X (    <.@:% ~)  Y│4219392│0.00405533641│17111.054 │
>> ├──────────────────┼───────┼─────────────┼──────────┤
>> │X (    <.@:(%~)) Y│8797184│0.02544385   │223834.23 │
>> └──────────────────┴───────┴─────────────┴──────────┘
>>
>> This shows, if I am not mistaken, that  <.@:% ~  dominates its counterpart
>>   ([: <. %)~  .
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Jan 20, 2016 at 6:30 PM, Henry Rich <[email protected]> wrote:
>>
>> I've not seen such a case, where [: u v is fast but not u@:v .
>>>
>>> Henry Rich
>>>
>>>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to