timing differences are sort of normal because computers have lots of other things going on:
timespacex '+:^:(1e5 1) 2' 0.005421 12160 timespacex '+:^:(1e5 1e4) 2' 0.003509 12160 timespacex '+:^:(1e5 1e4) 2' 0.004045 12160 FYI, -- Raul On Thu, Aug 10, 2017 at 3:28 PM, 'Pascal Jasmin' via Programming <programm...@jsoftware.com> wrote: > performance measurements imply that it doesn't duplicate it, > > a =. |. 4 }. i.63 > 20 timespacex 'a { +: ^: (<63 ) 2' > 2.168e_5 40832 > 20 timespacex ' +: ^: (a ) 2' > 1.944e_5 38144 > 20 timespacex ' +: ^: (63 ) 2' > 5.648e_6 1536 > > > these results don't differ by much, but surprised that they do differ. > > 200 timespacex ' +: ^: (63 3) 2' > 1.00992e_5 12160 > 200 timespacex ' +: ^: (63 62) 2' > 9.92639e_6 12032 > > > >>F^:(5 3) y >>does not do any calculation for the '3' ? > > >> yes its efficient, simply collecting the results of each iteration >> while the function is applied to the "last value". > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm