[Jprogramming] +/ slower than (+/ % #)/

David Mitchell davidmitchell at att.net
Wed May 20 23:31:25 HKT 2009


bill lam wrote:
> On Wed, 20 May 2009, Steven Taylor wrote:
>>    6!:2 'b=.+/ a'
>> 0.240794
>>    6!:2 '(+/ % #) a'
>> 0.13628
> 
> I think that 'a' is already cached when executed the tacit. You can
> compare
>    (100) 6!:2 'b=.+/ a'
>    (100) 6!:2 '(+/ % #) a'
> 

Some fixed tests:

    a =: ? 100000000 $ 100
    (100) 6!:2 'b=.+/ a'
0.441664432211
    (100) 6!:2 'b=.(+/ % #) a'
0.24710853195
    (100) 6!:2 'b=.(+/) a'
0.375218973361

--
Cheers,
David Mitchell



More information about the Programming mailing list