Cool Audit

Chrome Introduced Shared Memory Versioning to Enhance Browser Performance

Google Chrome recently implemented Shared Memory Versioning, improving its speed through more effective cookie handling.

This upgrade improves Chrome and other Chromium-powered browsers like Microsoft Edge and Vivaldi.

Resource contention arises as more people rely on the Internet to do their daily tasks, placing increased demands on browsers to run several programs simultaneously. 

The multi-process Chrome browser competes for various resources, including memory and CPU, of course, as well as its internal service queues. 

Google has been concentrating on locating and resolving slower interactions from field data submitted by Chrome users, which is the definitive source of actual user experiences. 

Google collects this field data by logging anonymized Perfetto traces on Chrome Canary and reporting them using a filter that protects privacy.

“When looking at field data of slow interactions, one particular cause caught our attention: recurring synchronous calls to fetch the current site’s cookies from the network service,” Google Chrome said in a blog post.

Shared Memory Versioning to Improve Slow Interactions

As browsers became more multi-processive over time, the process that hosted the cookie jar handled an increasing number of queries. However, replying to every query blocks because the Web Spec requires Javascript to fetch cookies synchronously.

The queue of requests may back up in high-traffic situations when numerous websites seek cookies (and other resources) from the network service.

“We discovered through field traces of slow interactions that some websites were triggering inefficient scenarios with cookies being fetched multiple times in a row,” Google said.

“ We were astonished to discover that 87% of cookie accesses were redundant and that, in some cases, this could happen hundreds of times per second.”

A novel paradigm named Shared Memory Versioning provides a solution to this issue.

The goal is to associate each document value.cookie with a version that increases monotonically.

Alongside that version, each renderer saves the last time it read the document.cookie. 

Working on Shared Memory Versioning

The shared memory is where the network service hosts the version of each document.cookie.

Thus, renderers don’t need to send an inter-process query to the network service to find out if they have the most recent version.

This resulted in an 80% decrease in cookie-related inter-process messages and a 60% speed increase in document.cookie access.

By monitoring Chrome’s field data in response to user interactions on all websites, Google Chrome has improved web performance and contributed to Core Web Vitals.

According to tests, pages can load up to 5% faster on all platforms.

While this gain may appear small, it is an essential component of a larger plan to improve browser responsiveness in general.