I may be stupid, but I'm going to suggest an interpreter
improvement (In WWII Admiral King replied to a similarly-
opened message of Kelly Turner's with a curt "delete all after
stupid.").

In a train like

(1 (0)} 0 = ]) 

the verb (0)} is not applied in-place.  It looks to me that it
should be possible to make it in-place, and that much could
be saved it it were.

The advantage of in-place execution is obvious in the verb (0}) ,
but I expect it will be worth the analysis time for all verbs,
because

  0.  reusing a memory area makes for more efficient use
    of cache,  since one operand's worth of cache resources
    are left untouched.

  1.  the main-memory stores for the result should be reduced, since
    the stores to cache will always be hits in the
    cache rather than requiring cast-outs of existing cache lines.

(some poring over processor specs may be called for to verify
these claims, and I would be willing to do that on request)



If each data block has a use count, the result of V0 and V2 in
(V0 V1 V2) should have a use count of 1, which would signal them
as candidates for in-place execution.

I am assuming that in something like

V0 name

the data block for 'name' has a use count of 2, one for the stored
value and one for its use as an operand to V0.  Similarly, in

(V0 V1 V2) V3 name

the result of V3 has a use count of 1, but that is incremented when
(V0 V1 V2) is executed, so that in-place operation would be possible on
V0 but not V2.


The reason for making

name =: op name

not in-place has been that recovery from error is a problem, but I
don't see how that applies to the intermediate results of long
verb phrases.



Henry Rich



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

Reply via email to