With boxed arrays, there is the additional overhead of adjusting
usecounts on the boxed elements. The new 8.06 beta greatly reduces this
overhead.
Henry Rich
On 10/1/2017 2:48 PM, David Lambert wrote:
Appreciated information, I had realized (correctly, I hope) that
re-analysis of data type and shape is the big time trouble of
unboxing, but I had not realized ... the other story with @.
However, Simply following Dan Bron's rule to use @: unless you know
you need @ has helped me.
Date: Sat, 30 Sep 2017 13:20:50 -0400
From: Henry Rich<[email protected]>
To:[email protected]
Subject: Re: [Jprogramming] Tacit Expressions with Explicit J Syntax
Message-ID:<[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
...
What is that overhead? In your examples using @, (1) parsing and (2)
bookkeeping.
Parsing: (3 :'-y')@- v is slow partly because every sentence of an
explicit entity is parsed anew when the sentence is executed. Thus the
sentence '- y' is parsed repeatedly. In
-@- y the verb, -@-, is parsed once.
Bookkeeping: every J noun can be an array with any type. Every time you
start a verb, each argument must be analyzed.
(3 :'-y')@- v starts 3 verbs for each cell: -, (3 :'-y'), and - again.
The - starts are quick, because they follow an optimized path for
arithmetic on singletons. (3 :'-y') is another story: starting an
explicit definition means getting ready for control structures, creating
a namespace, initializing the names xymnuv, and a bit more. That's
where most of the time is being spent.
-@- starts just the 2 verbs - and -, each of which is fast.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
---
This email has been checked for viruses by AVG.
http://www.avg.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm