New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance Audit 2017: Beacon: Review cookie access #173
Comments
This has been fixed in the Akamai fork and will be backported soon. |
@nicjansma Do you know when this is back-ported into this repo? |
There are two things we've optimized for cookies: the size, and how often we're getting/setting. The size improvements are already available in 8eea1d7 We've also improved the number of reads/writes we do in Boomerang, and this will be backported here within a few weeks. |
How this work is in going? |
Commit message: As part of the 2017 Boomerang Performance Audit we found that Boomerang was reading/writing the Cookie multiple times during the page load, and the relevant functions were showing up frequently in CPU profiles: These accesses don't take a ton of time, but on lower-class computers we see 2-5ms. After adding some instrumentation, on a blank page for a new session, we count the following accesses: Breakdown
Here's a breakdown per phase:
There's a lot of inefficiencies from the above access patterns. ChangesThe following changes were made:
This change removes a Cookie Set and 2 Cookie Gets (because each Set also does 2x Gets). We're now at:
This reduces Gets dramatically:
We still have 8 Gets because
I don't think we need to do this for every This reduces Gets again:
We're now left with the only 4 times we update the cookie:
FinalWe've reduced the 21 Gets to 2, and 8 Sets to 4: Gets
Sets
|
Boomerang and its plugins are getting/setting the page's cookie several times during the
onload
beacon preparation.In most browsers, getting and setting the cookie is a possibly-slow operation, since it often involves reading or writing state to the disk.
RT
alone callsgetCookie
6 times during theload
beacon preparation:We should investigate if all of these gets/sets are necessary and combine/eliminate any extraneous ones.
The text was updated successfully, but these errors were encountered: