Re-ordering Chrome resources in .pak files to improve Chrome startup time |
||||
Issue descriptionRe-ordering Chrome resources in .pak files to improve Chrome startup time. According to UMA Sampling Profiler data, Chrome spends a lot of time loading resources from .pak files during start up. This is likely caused by page faults incurred when a resource is first accessed (as each .pak filed is memory-mapped to the browser's address space but the data is not actually loaded into physical memory by the OS until a given page is first accessed). Design doc: https://docs.google.com/document/d/1jXsfVJOCG6qXrYwhGerYhDknG42LxAZWV0bWninznM0/edit#
,
Feb 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fe16437ea76d582b4a931e219cd452756e2c6498 commit fe16437ea76d582b4a931e219cd452756e2c6498 Author: asvitkine <asvitkine@chromium.org> Date: Sat Feb 18 13:15:24 2017 Add a script to GRIT to generate predetermined resource ids file. This script will be used to produce a resource ordering file with the resources loaded during Chrome startup sequence that will be fed back into GRIT via the mechanism implemented by: https://codereview.chromium.org/2690263004/ Also adds a README.md about how to use it. BUG= 692670 Review-Url: https://codereview.chromium.org/2696303003 Cr-Commit-Position: refs/heads/master@{#451458} [add] https://crrev.com/fe16437ea76d582b4a931e219cd452756e2c6498/tools/grit/grit/format/gen_predetermined_ids.py [add] https://crrev.com/fe16437ea76d582b4a931e219cd452756e2c6498/tools/grit/grit/format/gen_predetermined_ids_unittest.py [add] https://crrev.com/fe16437ea76d582b4a931e219cd452756e2c6498/tools/gritsettings/README.md
,
Feb 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8a40fe5f00e8b6c3363194f69fe9b2b4f79781b8 commit 8a40fe5f00e8b6c3363194f69fe9b2b4f79781b8 Author: asvitkine <asvitkine@chromium.org> Date: Sat Feb 18 15:35:00 2017 Add an option to print the resource ids that Chrome loads. This output will be used to re-order Chrome's resources to improve startup time. BUG= 692670 TBR=jochen@chromium.org Review-Url: https://codereview.chromium.org/2699513002 Cr-Commit-Position: refs/heads/master@{#451463} [modify] https://crrev.com/8a40fe5f00e8b6c3363194f69fe9b2b4f79781b8/PRESUBMIT.py [modify] https://crrev.com/8a40fe5f00e8b6c3363194f69fe9b2b4f79781b8/ui/base/resource/data_pack.cc
,
Feb 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9a84244d0aabd3d3ee775adf82dc9acb2fefac31 commit 9a84244d0aabd3d3ee775adf82dc9acb2fefac31 Author: asvitkine <asvitkine@chromium.org> Date: Sat Feb 18 16:02:30 2017 Add option to GRIT to provide a resource ordering input file. This allows optimizing Chrome's start up sequence such that the resources that are loading during startup appear in order in the resource .pak files and thus incur less page faults to load from disk and a faster start up time and less memory used (due to less pages resident in RAM). This change adds the necessary infrastructure to support this, but does not yet enable it for any platform. That will be done in a separate change later. BUG= 692670 Review-Url: https://codereview.chromium.org/2690263004 Cr-Commit-Position: refs/heads/master@{#451464} [modify] https://crrev.com/9a84244d0aabd3d3ee775adf82dc9acb2fefac31/tools/grit/grit/format/rc_header.py [modify] https://crrev.com/9a84244d0aabd3d3ee775adf82dc9acb2fefac31/tools/grit/grit/format/rc_header_unittest.py [modify] https://crrev.com/9a84244d0aabd3d3ee775adf82dc9acb2fefac31/tools/grit/grit/grd_reader.py [modify] https://crrev.com/9a84244d0aabd3d3ee775adf82dc9acb2fefac31/tools/grit/grit/tool/build.py [modify] https://crrev.com/9a84244d0aabd3d3ee775adf82dc9acb2fefac31/tools/grit/grit_rule.gni
,
Feb 22 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4ed763c0d65098ab8be5c22040697b4e013311be commit 4ed763c0d65098ab8be5c22040697b4e013311be Author: asvitkine <asvitkine@chromium.org> Date: Wed Feb 22 14:44:14 2017 Provide startup resource numbering files for Mac and Windows. The resources in these files will be assigned the specified ids so that they're packed in the order that they're expected to be loaded on startup. This should reduce page faults incurred on start up and improve startup performance - especially on systems where I/O is slow. This uses the mechanism added in the following CL to do the renumbering: https://codereview.chromium.org/2690263004/ These files were generated using the script and README.md instructions being added in: https://codereview.chromium.org/2696303003/ These were generated from revision 451764 on a second run in a fresh user data directory. Browser was terminated using chrome://quit so that resources loading during shut down aren't included. BUG= 692670 Review-Url: https://codereview.chromium.org/2698913007 Cr-Commit-Position: refs/heads/master@{#452042} [modify] https://crrev.com/4ed763c0d65098ab8be5c22040697b4e013311be/tools/grit/grit_rule.gni [add] https://crrev.com/4ed763c0d65098ab8be5c22040697b4e013311be/tools/gritsettings/startup_resources_mac.txt [add] https://crrev.com/4ed763c0d65098ab8be5c22040697b4e013311be/tools/gritsettings/startup_resources_win.txt
,
May 10 2017
Just to provide an update here, the changes were landed in Q1 in Chrome client code for Mac and Windows and I did an analysis of the impact, outlined in this doc: https://docs.google.com/document/d/1x1zWEHJ2twSbh4VxRbzNn2HZdhnbCpTgOQAI7_sqvwE/edit# The TL;DR is that we were able to see an improvement to browser message loop start time, but no corresponding effect on NonEmptyPaint2 start up metrics. The doc suggests some next steps to improve our understanding of start up.
,
Jun 7 2017
,
Aug 3
Related idea: We should consider optimizing the order of res/ files as well.
,
Aug 3
Whoops, that last comment was meant for the android version of this: bug 615293
,
Sep 25
This has been implemented, so closing as Fixed (Verified). The big win was on Windows - iirc 300ms mean main message loop start time improvement when launched, where PAK IO was largely impacted by AVs intercepting it for some clients and thus reducing it had a big win at the mean. The system is in place to allow updating the order per following the README: https://chromium.googlesource.com/chromium/src.git/+/62.0.3178.1/tools/gritsettings/README.md |
||||
►
Sign in to add a comment |
||||
Comment 1 by asvitk...@chromium.org
, Feb 15 2017