Probably just my not understanding,  but the first sentence puzzles me:
"While most named nouns are local to the explicit definition they are used in,
most named verbs are in public namespaces and require a lookup."

I'd have expected While (most) A...,  (most) B... " This sentence seems to be comparing
most named nouns with most named nouns.

Sorry in advance!

Mike


On 28/01/2021 16:50, Henry Rich wrote:
The new beta has a feature to speed execution of systems with long search paths.  It should be generally applicable and I hope you will turn it on in your scripts to wring it out.

The implementation has heretofore followed the Dictionary's model of parsing and execution, which for named verbs is:

1. name is looked up to get its part of speech
2. (if name is a verb or undefined) a reference to the verb is allocated and put onto the execution stack 3. when the reference is executed, the name is looked up again to get its value

That's a minimum of 2 lookups per named verb.  If the verb is executed more than once (as in name"n) it is looked up every time it is executed.

Lookups are pretty quick, but each requires going through the locales in the search path, and the time can add up to something noticeable.

Nameref Caching (https://code.jsoftware.com/wiki/Vocabulary/Locales#namerefcaching) remembers the results of each non-noun lookup in step 1 and step 3, and reuses the result in most cases (it also remembers the lookups across multiple executions of the same explicit entity). A typical script, which observes a clear separation between code and data and where each verb reference always executes the same verb, can use Nameref Caching without modification.

Please give it a try.

Henry Rich




--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to