News for hackers. Stuff that matters.
Re:Tab throttling and more performance improvements in Chrom... by etaioinshrdlu on Tuesday November 17, 2020 @03:28PM (#25129347)
I wonder if this could cause background tabs to develop a large queue of unprocessed events, thus making the tab unresponsive for a while when switching back to it. I used to see this happen on native apps on macOS with App Nap for a while but it seems better on recent versions of macOS.
Re:Tab throttling and more performance improvements in Chrom... by antihero on Tuesday November 17, 2020 @03:33PM (#25129413)
I see this with the console at least when developing. You switch back to the tab and the console eats shit and locks up because of the back pressure.
Re:Tab throttling and more performance improvements in Chrom... by asah on Tuesday November 17, 2020 @04:18PM (#25129987)
the nice thing with the web is that developers respond reasonably fast (much faster than desktop apps) to changes like this in major browsers...
Re:Tab throttling and more performance improvements in Chrom... by imtringued on Wednesday November 18, 2020 @02:50AM (#25134165)
This a good point. The application does x amount of work per second in the background. Your browser pauses it for y seconds. According to Google you have saved "x times y times energy per operation". Chrome devs say hurray 5x energy savings. Except when you switch back to the tab you end up spending the same amount of energy to catch up.

The primary source of energy savings would be poorly written websites that constantly poll in the background. Games with complicated logic would still consume the same amount of energy.

Re:Tab throttling and more performance improvements in Chrom... by chhamilton on Wednesday November 18, 2020 @09:53AM (#25137380)
(Chromium dev here.)

For the most part, events can't really accumulate, because not running code means no new events are posted. The throttling applies to setTimeout/setInterval, and not to any external event (incoming network data, API callbacks, etc).

Sites that legitimately have to do a fixed amount of work per unit time (via timers) will simply do that work with 1 wake-up per minute. All things being equal, this still means less battery usage because energy usage is a function of both wakeups and total CPU usage.

> The primary source of energy savings would be poorly written websites that constantly poll in the background.

This is the key insight here, and really what we're going after. There is a lot of this on the web.