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 we mutate state for node values and then all params are checking to see if these values are updated on an interval. This is historically performance reasons, but maybe it makes sense to subscribe to changes using Zustand. That way, we're not constantly updating canvases for sliders or classes for booleans unless there's actually been a change.
This might come with other kinds of overhead so it needs investigating.
The text was updated successfully, but these errors were encountered:
As far as I can tell, every time state is changed in Zustand, it runs through a list of active subscribers and they all do their equality functions to know whether to fire.
If we have multiple updates per second (e.g. multiple inputs), this would mean Zustand runs through that list verrrry often. In practice, that list would be visible params.
This could be sensible if the inputs batched their updates so they only made one state change every frame. It still feels a bit pointless, as right now the components just check state every frame anyway.
It might make more sense to prevent canvas/Dom updates by just having the component only do those imperative updates if the incoming value has changed.
Currently we mutate state for node values and then all params are checking to see if these values are updated on an interval. This is historically performance reasons, but maybe it makes sense to subscribe to changes using Zustand. That way, we're not constantly updating canvases for sliders or classes for booleans unless there's actually been a change.
This might come with other kinds of overhead so it needs investigating.
The text was updated successfully, but these errors were encountered: