Ah, yes... I was taking the length of the representation from 3!:1 as
the size of the array.

You're right that that would leave out some memory management values.

That said, while I have seen m {~^:n or ^&m^:n get used (and that one
tends to be used with a list value for n), I have not seen }.^:n or
{.^:n or dyadic $^:n in use. Usually, u in u^:n is a compound verb.

I mean... I do agree that dyadic +^:n and *^:n sometimes get used, but
those tend to be more for illustration purposes and I don't think they
usually get used where performance matters.

Thanks,

-- 
Raul

On Wed, Mar 4, 2020 at 3:00 PM Henry Rich <[email protected]> wrote:
>
> It's hard to know what typical is.  Selection is pretty common, as are
> reshape, take, and drop, and they can operate on data without moving
> it.  Perhaps the most common operations are arithmetic, and they can be
> performed in place much of the time. Many operations, like u;.1, u/,
> u"n, can operate on data without moving it.  u;._3 goes to great lengths
> to avoid copying the input.
>
> The size of an array is 56 bytes + 8 bytes per axis + the data, all
> rounded up to a power of 2.
>
> Henry Rich
>
> On 3/4/2020 2:26 PM, Raul Miller wrote:
> > Hmmm...
> >
> > We're working with rank 1 lists here, so 40 bytes overhead for each array.
> >
> > Also, I think we should assume a 64 bit J implementation, so another 8
> > bytes for each value in these arrays.
> >
> > So... 'a' would be 800040 bytes and 'b' would be 80 bytes.
> >
> > Anyways... the expression b { 9999999 ,~ ] a looks like it'll build a
> > modified copy of a for another 800048 bytes and then build its result
> > for another 80 bytes. Hypothetically speaking, that 800048 byte
> > intermediate result could be avoided, and I guess this is a relatively
> > common pattern for people wanting to avoid index errors.
> >
> > That said, testing, on j901, I see timespacex reporting 1536 bytes
> > consumed in the intermediate result. So I guess that means you've
> > implemented support for this pattern. Sounds good to me.
> >
> > On the other hand, the operations in this example are much simpler
> > than typical cases for u in u^:n, aren't they?
> >
> > Thanks,
> >
>
>
> --
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to