Let’s say I have many components, and on some user event I click a component which visually changes that single component only.
If I naively call repaint on all the other components including the one that was clicked, only the one that was clicked will visually change because each repaint checks for whether it was clicked.
What I’m wondering is if calling repaint on these unchanged components even if they visually look unchanged is causing some huge performance overhead behind the scenes if there are around 500-1000 of these.
In other words, upon clicking for the mouse event, is it more efficient for me to check whether repaint is worth calling (or whether a sendpropertychangemessage if using a valuetree is worth calling) before actually sending that message or calling repaint - to prevent unnecessary repaint calls basically.
Or, does repaint() automatically see that nothing needs to be changed and therefore this call (to change nothing) is fairly lightweight in this context.
Many thanks in advance.