Hacker News new | ask | show | jobs
by piker 25 days ago
You only redraw when there’s interaction. In exchange you use basically no memory for state retention which frees up the real resource constraint.
2 comments

Redrawing the whole thing consumes resources. That's power and resources not available to other tasks. There is value in being clever with what you draw.
Yes but it comes at the trade off persistent memory usage. It isn’t just free, and depending on the application in question that may be a lot better trade to make if, say, the app runs in the background or is rarely interacted with.
Moving the mouse is an interaction because there are hover effects.