[I wrote this earlier and had thought I sent it, but apparently I did
not.  My apologies if you get two copies of this message.]

On Fri, Dec 9, 2011 at 1:43 PM, Aai <agroeneveld...@gmail.com> wrote:
> Well, how about
>
>    r=.1e6 ?@$9
>    ts '({.,#)/.~r'
> 0.007779 1344
>
>    ts '(~.,#)/.~r'
> 0.083331 1.46822e7

That's not exactly the issue, but you are right that there is an issue
here which I was overlooking:

   ts '({.,#)/.~r'
0.00791187 2688
   ts '(~.,.#/.~)r'
0.0170171 3200
   ts '({./.~,.#/.~)r'
0.081353 2.62182e7
   ts '{./.~r'
0.0649097 2.62168e7
   ts '#/.~r'
0.00836571 2304

It looks like ({.,#)/.~ has special code, because ({.,#)/.~ is
significantly faster than {./.~ and about the same speed as #/.~ (in
my measurement, here, ({.,#)/.~  was trivially faster than #/.~ but
half a dozen repeated measurements on #/.~ gave me times ranging from
0.00643201 though 0.0103748)

That said, I still prefer calculating ~. and #/.~ separately, though I
should keep the above in mind when I am dealing with speed critical
code.

-- 
Raul
I still prefer what is currently the slower approach.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to