You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, BaseNode.value is implemented using a getter() property which in turn updates the node via the call() function (which in turn uses the calc() function).
This results in updates when they aren't needed, as everytime the value of any node is accessed, not only does the node recalculate it's current value, but the node's parent values are also accessed and recalculated.
Also, reasoning about the update behavior and when exactly a node's call function is being used is getting complicated.
To alleviate this, BaseNode.value (or BaseNode.output.value) should be a simple property that is being updated by the node when it's recalculating. This way it is clear when the node should compute its output and when it's just being read.
One thing that needs to change is that the computation flow.
Currently, it's starting at the final output node, which is calling it's connected input nodes which are calling their inputs etc.
One possible solution would be to trigger a computation in every node's connected output nodes on update. This might trigger unwanted behavior in nodes with side effects though, as they are being implicitly called.
Another solution could be to mark any descendant nodes with a 'dirty' attribute on computation, and to recalculate any ancestor nodes that are dirty on call.
The text was updated successfully, but these errors were encountered:
Currently, BaseNode.value is implemented using a getter() property which in turn updates the node via the call() function (which in turn uses the calc() function).
This results in updates when they aren't needed, as everytime the value of any node is accessed, not only does the node recalculate it's current value, but the node's parent values are also accessed and recalculated.
Also, reasoning about the update behavior and when exactly a node's call function is being used is getting complicated.
To alleviate this, BaseNode.value (or BaseNode.output.value) should be a simple property that is being updated by the node when it's recalculating. This way it is clear when the node should compute its output and when it's just being read.
One thing that needs to change is that the computation flow.
Currently, it's starting at the final output node, which is calling it's connected input nodes which are calling their inputs etc.
One possible solution would be to trigger a computation in every node's connected output nodes on update. This might trigger unwanted behavior in nodes with side effects though, as they are being implicitly called.
Another solution could be to mark any descendant nodes with a 'dirty' attribute on computation, and to recalculate any ancestor nodes that are dirty on call.
The text was updated successfully, but these errors were encountered: