Check if the current value of a spring is already set to what you're trying to update it to
So basically checking if output.cache is equal to "v" when trying to set the current position of a spring (similar to source.luau).
I doubt this would ever happen normally unless you're trying to set the spring to its current value, or if you are setting it to its target position (after it's reached it). I don't really believe it would have any performance benefits as graph.update_descendants is only called the next time the spring is stepped, but it wouldn't hurt adding.
This isn't necessary because what spring() does is create an effect internally to the input source. But the input source will not run effects if it is set to the same value. So this not-equals check you are proposing is already being done, just not by the spring.
Not sure if it was clear but I meant to add this check for the feature added in this pull request https://github.com/centau/vide/pull/36
The reason I proposed this was because to me it looks like the spring would still schedule itself to be updated even if the position you set it to was the position it was already at.
Sorry for the late reply,
I see what you mean now. Since the purpose of that pull request was to allow the instant setting of a spring's current output, as well as the resetting of its velocity, there may be the rare case that output.cache is equal to the new value but the velocity is non-zero and you intend to reset the velocity which this change would prevent you from doing.
In any other case it isn't a performance concern anyways because the spring will unschedule itself in the next step.