This article is more than 1 year old

Google Chrome fights the power drain (again)

Battery usage optimization comes to Apple MacBooks

Google's code gremlins have been tweaking the company's Chrome browser under the hood to help Apple's MacBooks consume less power.

Chrome has long had a reputation for being less than frugal when it comes to power consumption. These issues can arise from software design choices, bugs, and ill-behaved third-party extensions.

Regardless, Google has intermittently made efforts to curb Chrome's thirst for energy. In January 2021, for example, Chocolate Factory software engineers tried to reduce the power consumption of Chrome on mobile devices by throttling JavaScript timers.

Even so, Chrome has generally lagged behind Apple Safari but ahead of Mozilla Firefox [PDF] when it comes to power consumption.

Apple on its website claims Safari provides browser users with up to two hours more streaming video than Chrome, Edge, and Firefox, and with up to 17 hours of wireless video, based on its own test using a 13-inch MacBook Pro with Apple M2, 8GB of RAM, 256GB SSD, and a pre-release version macOS Ventura.

In an effort to do better, Google announced battery and memory optimizations on December 8, 2022. The arrival of Chrome 108 about a week earlier brought two new performance settings, Energy Saver and Memory Saver, to maximize battery life when a device battery is low and to free up unused memory. These were rolled out globally for Chrome on Windows, macOS, and ChromeOS in the weeks that followed.

Concurrently, Google has been adjusting the way Chrome processes data. These changes have been appearing in a gradual rollout via Chrome 108 (November 29, 2022), 109 (January 10, 2023), and 110 (February 7, 2023), and are expected to hit 100 percent coverage by the end of the week.

In a blog post provided in advance to The Register, Chrome software developer François Doray explains that the team has made several low-level changes to achieve better battery life on Apple MacBooks.

First, Google engineers have been adjusting how Chrome manages garbage collection and memory compression for recently created iframes. The result has been reduced power usage.

Second, JavaScript timers, put on a power diet two years ago, saw further adjustment.

"JavaScript timers were introduced at the beginning of the Web's history," said Doray. "Since then, Web developers have access to more efficient APIs to achieve the same (or better!) results. But JavaScript timers still drive a large proportion of a Web page's power consumption. As a result, we tweaked the way they fire in Chrome to let the CPU wake up less often."

This also involved efforts to cancel internal timers that were no longer needed. Timer cleanup happens to be a common memory management recommendation in the JavaScript world.

Third, Google's coders made data structure access more efficient by making key/value lookups take less time.

And finally, Googlers tested websites with a bot to find Document Object Model (DOM) change patterns that don't change pixels on the screen. Chrome was then modified to detect these patterns and to bypass the browser's style, layout, paint, raster, and GPU steps when these patterns occur since no visible page change is required.

All told, these adjustments now mean you should be able to browse in Chrome for 17 hours or watch YouTube for 18 hours on a MacBook Pro (13", M2, 2022), said Doray, citing Google's open source benchmark test suite.

Your move, Safari. ®

More about

TIP US OFF

Send us news


Other stories you might like