-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
With the introduction of the computed!
and memo!
macros, it can be guaranteed that the dependencies provided are tracked with every re-evaluation of a node.
So it should be possible to separate them into "static" and "dynamic" dependencies. And because most of dependencies will be static, this can be used to optimize runtime behavior in the following ways:
- There is no need to dynamically track static dependencies anymore. They are stored in the
Computed
node at construction time only. - Evaluation can be separated into a iterative and a recursive part. The iterative part makes sure that all static dependencies are up to date before executing the computation and the recursive part "forces" the dynamic dependencies to be re-evaluated. This should keep recursion depths at bay, though I am not sure how effective this is in practice.