3 ms·
But then if you switch windows or tabs, the timer for the animations in the tab that is now invisible can be stopped, surely?? Why redraw an invisible window?
by 72deluxe 10y ago
But then if you switch windows or tabs, the timer for the animations in the tab that is now invisible can be stopped, surely??
Why redraw an invisible window? In any ordinary paint routine, you query for the invalidated rectangle and only redraw what you must. In the case of pages that are out of view, then nothing needs redrawing.
Processes that are busy doing things they need not (like redrawing on a timer, polling a mouse) is why Apple starting highlighting offenders in macOS (what is hogging the battery??) and why I don't use Chrome on it - it just gobbles power keeping all of those tabs alive.
Hopefully these new changes will help.
- artursapek 10y agoOP here. In my case, the CPU saved was mostly React updating its virtual DOM. Yes, the browser doesn't do repaints when the tab is in the background. But there's plenty of other work that is done before repaints when using a library like React.