Google Chromium Improving Performance by Adjusting Cookie Request Method

TapTechNews June 6th news, Google Chromium blog posted a blog post on June 3rd, stating that by adjusting the way of requesting cookies, early tests show that the performance of all platforms has improved.

 Google Chromium Improving Performance by Adjusting Cookie Request Method_0

Problem lies

In the era of single-process browsers, since relevant data is all stored in memory, cookies can be managed relatively easily. And now mainstream browsers including Chrome use multi-process to improve performance and security.

Chrome browser runs a new process for each window and some other functions, meaning the method of handling cookies must call for more queries, thus slowing down the running speed.

Google says that in Chrome browser, repeated requesting of cookies is the reason that causes many interactions to slow down. TapTechNews translated the content of Google's blog post as follows:

Through on-site tracking of slow interactions, we found that some websites are triggering inefficient scenarios of continuously obtaining cookies multiple times.

We adopted additional metrics to measure the frequency of redundancy (returned value is the same as the previous one) of GetCookieString() IPC occurring in all navigations.

We were surprised to find that 87% of cookie accesses are superfluous, and in some cases, this situation may occur hundreds of times per second.

In some cases, especially when multiple websites make rapid requests simultaneously, these requests may occur hundreds of times per second, causing serious delays. Eventually, the old method of obtaining cookies from the network service synchronously (one at a time) creates a bottleneck.

 Google Chromium Improving Performance by Adjusting Cookie Request Method_1

Solution

Google says Chrome browser no longer repeatedly checks the network service, but saves a local copy of the cookie data and its version number. In this way, Chrome browser can check whether the cookie has the latest data without repeated requesting.

According to Google engineers, this change reduced the amount of cookie-related information by 80% and sped up the cookie accessing by 60%.

Google officials said in the blog post:

Our idea is that each value of document.cookie is now paired with a monotonically increasing version. Each renderer will cache the last-read document.cookie together with that version.

The network service will save each version of document.cookie in shared memory. Therefore, the renderer can know whether it has the latest version without sending an inter-process query to the network service.

 Google Chromium Improving Performance by Adjusting Cookie Request Method_2

In early tests, Google observed that after deploying this update on all platforms, the performance increased by up to 5%.

Likes