G'day,

Still J-ing along, I believe I ran into a little performance issue.

I can strip it down into:


A3=:?1000000 3$100 NB. three columns of random numbers 0 .. 99

A31 =: A3,.1 NB. with an extra column of 1-s

A4=:?1000000 4$100 NB. or four random columns

6!:2 'echo $~.A3'

632783 3

0.037673

6!:2 'echo $~.A31'

632783 4

24.6091

That's 600 times longer!


However,

6!:2 'echo $~.A4'

995025 4

0.43277

is again much quicker.


This is consistent over versions 807, 903 and 904, all with Ubuntu linux.


I do need the fourth column and it has many 1-s (not all).


Thanks,

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

Reply via email to