Jump to content

Chrome JavaScript throttling experiment improves Battery significantly


Karlston

Recommended Posts

Chrome JavaScript throttling experiment improves Battery significantly

Web browsers uses a lot of battery when they are run on mobile devices such as laptops. While it helps to use content blockers and other extensions to remove or block elements that may draw additional power, it is still problematic from a user perspective.

 

Google has run experiments in the past couple of months in its Chrome web browser to find out if the throttling of JavaScript in background tabs has an effect on the battery usage of the web browser.

 

Chromium engineers decided to analyze "the work done by popular sites in the background" and determined that "a lot of work was done from JavaScript timers"at were not "valuable to the user" often.

 

The idea was born to reduce the number of wake ups from JavaScript timers in background tabs in the web browser to find out if that would improve battery life.

 

Currently, JavaScript wake ups are limited to 1 wake up per second in stable versions of the Chrome web browser.

 

Google ran several experiments to determine if the throttling of JavaScript wake ups would improve battery life. Here are the results:

 

Experiment 1: 36 popular sites in background tabs, about:blank in foreground.

  • Current status: Median time to discharge 6.4 hours
  • Throttled status: Median time to discharge 8.2 hours

Experiment 2: 36 background tabs, YouTube in foreground

  • Current status: Median time to discharge 4.7 hours
  • Throttled status: Median time to discharge 5.3 hours

A new Chrome experimental flag is available to enable the feature in development versions of the Chrome we browser (Canary).

 

chrome-throttle javascript timers battery

  • Name: Throttle Javascript timers in background.
  • Description: When enabled, wake ups from DOM Timers are limited to 1 per minute in a page that has been hidden for 5 minutes.

Here is how to enable the experiment:

  1. Load chrome://flags in the web browser's address bar.
  2. Search for Throttle Javascript timers in background.
  3. Set the flag to Enabled.
  4. Restart the browser.

Google Chrome will limit JavaScript timers of background pages after the restart automatically; this is applied to pages that have been in the background for at least five minutes.

 

The feature may be introduced in Chrome 86 on the desktop (currently Canary).

 

Google plans to introduce an Enterprise policy to disable the intervention. The idea behind the policy is to provide administrators with an option to turn the functionality off if they notice that it breaks functionality.

 

Tests will be run to find out if the feature will break certain features on sites.

 

Other Chromium-based browsers such as Microsoft Edge, Brave, Vivaldi, or Opera, will get the feature as well unless the developers of the browsers deactivate it actively. It is very likely that Mozilla will implement this also in the Firefox web browser in the future.

 

Battery life improvements are always welcome, especially if a small change extends the battery life by a lot.

 

 

Chrome JavaScript throttling experiment improves Battery significantly

 

ThanksForReading200x49.jpg

Link to comment
Share on other sites


  • Replies 2
  • Views 868
  • Created
  • Last Reply

Google's Chromium browser team has come up with a simple fix to address heavy battery drain.

 

The browser has long been recognized as a powerful, stable utility, but one that tends to hog resources. The impact is felt particularly by laptop users.

 

The Windows Club web site, devoted to Windows-related tips and tricks, was the first to detect a new feature in the recently released Chrome 86 browser that addresses the memory issue. Google is testing an option that restricts the number of Javascript 'wake-up' calls to web pages residing in the background.

 

Current Chrome settings allow up to one wake-up call per second.

 

Google researchers ran tests in which they throttled the timers so they could be accessed only once a minute.

 

In an experiment, they opened 36 web pages on individual tabs and tested how long it would take to drain the battery.

 

With Chrome browsers, the batteries operated for 7 hours, while Safari browsers lasted 9.4 hours. But with throttling, Chrome browsers eked out an additional 28 percent of battery usage—1.8 additional hours of life, for a total of 8.8 hours.

 

In a second test, Google opened 36 browser tabs while a YouTube video played on the active tab. Limiting Javascript wake-up calls provided an additional half hour of battery life, or a 13 percent boost.

 

The way Chrome currently operates, constant, wasteful, memory-consuming wake-up calls would be sent to each of those 36 background tabs.

 

Until Google makes the upgraded feature official, users can download Chrome from the canary channel, and enter code into the address bar to test the memory saving feature. Users should type "chrome://flags" (without the quotes) and then type "chrome://flags/#intensive-wake-up-throttling". This will reschedule Javascript timers running in the background.

 

The feature will soon be available for all devices including mobile and desktop devices. Igt will work with all platforms including Windows, Android, Chrome OS, Mac and Linux.

 

The feature can be disabled if a user prefers the frequent timer function.

 

The Chromium team published a paper called "Throttling JavaScript Timers to Reduce Battery Usage in Background Tabs," in which they explained that web site developers access the timers for various analytical functions.

 

"We used Devtools to inspect the work done by popular sites in the background," the report states. "We found that a lot of work was done from JavaScript timers. Furthermore, we found that the work done from these JavaScript timers was often not valuable to the user when the page was backgrounded (eg checking if scroll position changed, reporting logs, analyzing interactions with ads)."

 

Introduced in 2008, Google Chrome now boasts a 68 percent market share of all browser users, leaving Firefox, Safari, Edge, Internet Explorer and Opera in the dust.

 

Source

Link to comment
Share on other sites


Similar topics merged.

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...