Page MenuHomePhabricator

ORCHESTRATOR PERFORMANCE: Mark ZWrappers as Fully Resolved; Skip Fully Resolved Objects when Eagerly Evaluating
Open, MediumPublic

Description

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

Event Timeline

Mcastro triaged this task as Medium priority.Apr 4 2024, 4:42 PM
Mcastro moved this task from To triage to Backlog on the Abstract Wikipedia team board.