Google tweaks Chrome to reduce MacBook battery drain

By

The Chrome browser may soon become a more efficient MacBook battery user.
The Chrome browser may soon become a more efficient MacBook battery user.
Photo: Google/Apple

Google said Tuesday it’s making several changes to the Chrome browser to make it less of a MacBook battery hog. Modifications include adjusting timers to wake the CPU less often, tuning memory compression and further optimizing Energy Saver mode.

The company’s tests using a 13-inch M2 MacBook Pro suggest the tweaks may help folks browse for 17 hours or watch YouTube for 18 hours on a single charge.

Google goes under Chrome’s hood to help improve MacBook battery life

The changes follow recent tweaks to Chrome’s Memory Saver and Energy Saver modes. Safari is considered lighter and friendlier to various resources on a Mac, but Google keeps refining Chrome to make it a tough competitor, especially given its extensive feature-set.

Google sent Cult of Mac a rundown of the latest changes:

We made a bunch of under-the-hood improvements with Chrome to help maximize battery life on MacBooks, from tweaking timers so that the CPU wakes up less often to fine tuning memory compression. As a result, we found that Chrome users could now approximately browse for 17 hours or watch YouTube for 18 hours on a MacBook Pro (13-inch M2, 2022) on a single charge.

A new post Monday on Google’s The Fast and the Curious blog further details the newest improvements, including how they should extend to older Mac models:

“With Chrome’s Energy Saver mode enabled, you can browse 30 minutes longer on battery,” noted Chrome developer François Doray. “Of course, we care deeply about all our users, not just those with the latest hardware. That’s why you’ll also see performance gains on older models, as well.”

Doray outlined the changes and included some details.

Small changes to iframes

This image represents the results of tweaking iframes.
This image represents the results of tweaking iframes.
Photo: Google

The HTML feature known as an iframe helps load other elements on a webpage, such as nesting an HTML page in an existing page or loading an ad or a video.

“We realized that many iframes live just a few seconds,” he said. “As a result, we fine-tuned the garbage collection and memory compression heuristics for recently created iframes. This results in less energy consumed to reduce short-term memory usage (without impact on long-term memory usage).”

Adjusting Javascript timers 

Google depicts its more efficient Javascript timers.
Google depicts its more efficient Javascript timers.
Photo: Google

Doray referred to Javascript timers, which have been around since the start of web development. Chrome will better-optimize their use.

“Javascript timers still drive a large proportion of a Web page’s power consumption,” Doray said. “As a result, we tweaked the way they fire in Chrome to let the CPU wake up less often.”

“Similarly, we identified opportunities to cancel internal timers when they’re no longer needed, reducing the number of times that the CPU is woken up,” he added.

Optimizing access to data structures

Doray noted that Google identified frequently accessed data structures by the same key and “optimized their access pattern,” shown below.

Google also changed some access patterns to data structures.
Google said it also changed some access patterns to data structures.
Photo: Google

Nixing some website redraws

Google also drew on insights gained by examining external sites and how Chrome interacts with them.

“We navigated on real-world sites with a bot and identified Document Object Model (DOM) change patterns that don’t affect pixels on the screen,” Doray said. “We modified Chrome to detect those early and bypass the unnecessary style, layout, paint, raster and GPU steps. We implemented similar optimizations for changes to the Chrome UI.”

Finally, Doray noted this kind of work never stops, and Google hopes to further-improve Chrome’s battery efficiency with the help of a broader community of developers through the open-source benchmark suite.

Newsletters

Daily round-ups or a weekly refresher, straight from Cult of Mac to your inbox.

  • The Weekender

    The week's best Apple news, reviews and how-tos from Cult of Mac, every Saturday morning. Our readers say: "Thank you guys for always posting cool stuff" -- Vaughn Nevins. "Very informative" -- Kenly Xavier.