Description
When retrieving arguments for a function call, and again when returning the result of a top-level function call, the orchestrator calls the eagerlyEvaluate function. This function recursively descends into a ZObject, resolving any member of the danger trio (Z9, Z7, Z18) that it finds.
Sometimes, an already-resolved argument becomes part of another argument (e.g., in the case of recursive calls to the CONS function). In these cases, we might call eagerlyEvaluate multiple times. This can get expensive for large objects.
We could instead mark a ZWrapper as fully resolved whenever it is, indeed, fully resolved. Namely,
- when resolveKey or resolveEphemeral has been called on all keys pertaining to this object OR
- resolve* has been called on a key that isn't a member of the danger trio
AND
- when all ZObjects that are members of the ZObject are themselves fully resolved.
There are nuances to consider here. Z9s and Z7s that do not contain Z18s can be resolved at any time; Z18s or complex objects containing them might not be resolvable the first time we attempt eager evaluation. The "full resolution" logic (and the attending complexities added to eagerlyEvaluate) must account for this case.
This will be a beneficial performance change in any case. It may become much more important when/if we decide to eagerly evaluate all return values instead of eagerly evaluating only the return values of top-level function calls.
Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)
- ...
Remove all the non-applicable tags from the "Tags" field, leave only the tags of the projects/repositories related to this task
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Back-end_Task/Bug_completion_checklist