Google is testing a change to its Chrome browser that will let it consume anywhere between 13% to 28% less battery on devices. The update relates to tweaking the JavaScript timer wake up frequency for the tabs that have been hidden or inactive for five minutes or more, resulting in lesser power consumption. The search giant is currently testing this feature in Chrome Canary via a hidden flag (spotted by TheWindowsClub).
The company also posted a document providing more information about the test it ran and the results that it obtained with the feature enabled. The team says that it noticed that a lot of the processing was often done by JavaScript timers – timers that specify intervals between which a set of code should execute, such as changing advertisement banners or running a real-time clock.
It added that the work from these timers was not valuable when a page was in the background because it included tasks such as checking if the scroll position changed, reporting logs, and analyzing interactions with ads. Therefore, it ran two tests after changing the wake ups on background tabs to one per minute to analyze the impact on performance and battery. The tests were performed on a top-of-the-line 2018 MacBook Pro running an Intel Core i9 processor with 32GB of RAM.
In the first test, the company opened 36 tabs (set of 18 tabs twice) in the background with the foreground tab being set to about:blank. The background tabs included sites such as Gmail and Facebook that were logged in and more. The test was performed until the MacBook battery ran out. For comparison, it ran the same experiment using Safari. Throttling the JavaScript timers aggressively in Chrome resulted in a two-hour improvement (28%) in battery drain as against the feature turned off. The results were closer to the numbers observed on Safari.
Median time to discharge | Min time to discharge | Max time to discharge | |
---|---|---|---|
No change | 6.4 hours | 6.4 hours | 7.0 hours |
Throttling JS Timers to 1 wake up per minute | 8.2 hours | 8.2 hours | 8.8 hours |
Safari | 9.3 hours | 9.1 hours | 9.4 hours |
For the second test, the team ran the same test but with a YouTube video running in the foreground in full screen. It adds that this test was to “verify the hypothesis that reducing the work in background tabs helps extend battery life even when there is foreground activity”. This test resulted in a 36-minute improvement (13%) in battery life.
The search giant adds that changing the JavaScript wake-up timers will not break the user experience and that it should not affect applications that rely on “WebSockets or long polls to receive messages or updates”. Users that want to try out the feature can head to chrome://flags on the Canary version of the browser, search for ‘Throttle JavaScript timers’, and enable the ‘#intensive-wake-up-throttling’ flag.
The Improvements will benefit the browser on Windows, macOS, Chrome OS, Linux, and Android. The increased efficiency will indeed be a welcome addition for users. Interestingly, the flag has also been added to Edge Canary, suggesting that Microsoft’s browsers too will receive this feature.