As I think about it, I see that the speedup can't be better than a factor of 2, so the numbers I quoted below must result from the details of in-place append.
However, the speedup should average almost exactly a factor of 2 (1 copy instead of 2), so maybe it's worth doing, since vector lists are potentially pretty big. Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Henry Rich > Sent: Tuesday, January 02, 2007 8:53 PM > To: 'Programming forum' > Subject: RE: [Jprogramming] Special code for dyad (, ,) ? > > Looks better if it's an in-place append: > > x=: 1e5 [EMAIL PROTECTED] 100 > y0=: 100 1000 [EMAIL PROTECTED] 100 > y1=: ,y0 > ts=: 6!:2 , 7!:[EMAIL PROTECTED] > ts 'x =: x,,y0' > 0.00282366 1.5735e6 > ts 'x =: x,y1' > 0.000432159 640 > > Henry Rich > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Roger Hui > > Sent: Tuesday, January 02, 2007 8:36 PM > > To: Programming forum > > Subject: Re: [Jprogramming] Special code for dyad (, ,) ? > > > > The prospective special code will have a hard time > > making the "factor of 2" threshold. > > > > x=: 1e5 [EMAIL PROTECTED] 100 > > y0=: 100 1000 [EMAIL PROTECTED] 100 > > y1=: ,y0 > > > > ts=: 6!:2 , 7!:[EMAIL PROTECTED] > > ts 'x,,y0' > > 0.00322862 1.5735e6 > > ts 'x,y1' > > 0.0022081 1.04922e6 > > > > > > > > ----- Original Message ----- > > From: Henry Rich <[EMAIL PROTECTED]> > > Date: Tuesday, January 2, 2007 5:26 pm > > Subject: [Jprogramming] Special code for dyad (, ,) ? > > > > > The docs show special code for things like ($ ,) and > > > ({. ,) etc, but not for (, ,) . > > > > > > I am drawing some long vector lists and I hate to see the > extra copy > > > when I do something like > > > > > > displaylist =: displaylist , , long_2D_vector_list > > > > > > > ---------------------------------------------------------------------- > > For information about J forums see > > http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see > http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
