Starting to close the gap with Safari —

New Chrome experiment promises up to 28% more battery life

Throttling JavaScript timers stops background tabs from sucking up so much power.

The latest experimental addition to the Chrome browser promises to save a ton of power usage. As spotted by TheWindowsClub, a new flag in the Canary version of Chrome called "Throttle Javascript timers in background" will cut down on the processing that normally happens in background tabs, and it could add two hours to a laptop's runtime.

JavaScript timers often track user interaction with a webpage, checking things like the scroll position and ad interaction while a tab is open. This also happens on background tabs, which really isn't useful since, by definition, a background tab isn't being interacted with. When you have a bunch of tabs open, these timers can chew through a good amount of battery for no reason. Now, in Canary, if you turn on the "Throttle Javascript timers" setting, any tab that has been in the background for more than five minutes will have these timers disabled, with wake-ups limited to once per minute. Normally, background tabs can trigger a wake-up once per second.

The flag in Canary links to a load of documentation detailing Google's test runs with this new feature. For the first test, the company grabbed a 2018 15-inch Macbook Pro and loaded up 36 background tabs with a blank foreground tab, then let the laptop run until it died. With throttling on, the laptop lasted two hours longer, or 28 percent longer, than the default settings. That's a huge improvement, but it still can't get Chrome up to the level of Apple's Safari, which bested Chrome by three hours with the default settings and by one hour with the new throttling flag.

The first test showed just how much power can be sucked up by background tabs, but the next test was more of a real-world use case. It swapped out the blank foreground tab for a YouTube video. With an actual foreground task going on, the difference was less dramatic but still significant: without throttling tabs, Chrome lasted 4.7 hours, and with throttling, it got an extra 39 minutes, lasting 5.3 hours. Safari was not included in the second test.

While these are promising results, Google's document says the company is still investigating how limiting background timers will affect webpages. While Google says "we found that the work done from these JavaScript timers was often not valuable to the user when the page was backgrounded," the company also doesn't want to break webpages provide valuable background services, like incoming chat and video messages, media playback, and notifications. After a 50 percent rollout on the Canary version, Google plans to gather feedback from Web developers before the change hits the wider Chrome user base.

Listing image by Chrome

Channel Ars Technica