Can excessively tweening a UIgradient hamper performance?

Hey there! I’m animating a UI gradient by tweening the rotation and this tween is set to repeat indefinitely by setting the repeat count to a negative number in the TweenInfo object, and I wanted to know if I should cancel the tween if the object is not visible on the screen. I’m not sure if this is a premature optimization because when I stress tested this on 1000+ gui elements the script activity level was still 0 and everything was running smooth, so I’m not sure if maybe roblox already optimizes tweens or if I should cancel them if the gui element is not visible. What do you think I should do?

Tweens don’t usually hamper performance by much. That is if it’s optimised and on the client (UI’s).

If you worried about performance, then you create a function for the tween, disconnect it and destroy it once the UI is not visible and vice versa. Generally, tweens don’t impact performance that much. But always optimise it by cleaning it up when not needed.