| OLD | NEW |
| 1 # Tools for Analyzing Chrome's Binary Size | 1 # Tools for Analyzing Chrome's Binary Size |
| 2 | 2 |
| 3 These currently focus on Android and Linux platforms. However, some great tools | 3 These currently focus on Android and Linux platforms. However, some great tools |
| 4 for Windows exist and are documented here: | 4 for Windows exist and are documented here: |
| 5 | 5 |
| 6 https://www.chromium.org/developers/windows-binary-sizes | 6 https://www.chromium.org/developers/windows-binary-sizes |
| 7 | 7 |
| 8 There is also a dedicated mailing-list for binary size discussions: | 8 There is also a dedicated mailing-list for binary size discussions: |
| 9 | 9 |
| 10 https://groups.google.com/a/chromium.org/forum/#!forum/binary-size | 10 https://groups.google.com/a/chromium.org/forum/#!forum/binary-size |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 * Default is to build just two revisions (before & after commit) | 23 * Default is to build just two revisions (before & after commit) |
| 24 * Rather than building, can fetch build artifacts from perf bots (`--cloud`) | 24 * Rather than building, can fetch build artifacts from perf bots (`--cloud`) |
| 25 | 25 |
| 26 1. Measures all outputs using `resource_size.py` and `supersize`. | 26 1. Measures all outputs using `resource_size.py` and `supersize`. |
| 27 1. Saves & displays a breakdown of the difference in binary sizes. | 27 1. Saves & displays a breakdown of the difference in binary sizes. |
| 28 | 28 |
| 29 ### Example Usage | 29 ### Example Usage |
| 30 | 30 |
| 31 # Build and diff HEAD^ and HEAD. | 31 # Build and diff HEAD^ and HEAD. |
| 32 tools/binary_size/diagnose_bloat.py HEAD | 32 tools/binary_size/diagnose_bloat.py HEAD -v |
| 33 | 33 |
| 34 # Diff OTHERREV and REV using downloaded build artifacts. | 34 # Diff OTHERREV and REV using downloaded build artifacts. |
| 35 tools/binary_size/diagnose_bloat.py REV --reference-rev OTHERREV --cloud | 35 tools/binary_size/diagnose_bloat.py REV --reference-rev OTHERREV --cloud -v |
| 36 | 36 |
| 37 # Build and diff all contiguous revs in range OTHERREV..REV for src/v8. | 37 # Build and diff all contiguous revs in range OTHERREV..REV for src/v8. |
| 38 tools/binary_size/diagnose_bloat.py REV --reference-rev OTHERREV --subrepo v
8 --all | 38 tools/binary_size/diagnose_bloat.py REV --reference-rev OTHERREV --subrepo v
8 --all -v |
| 39 | 39 |
| 40 # Display detailed usage info (there are many options). | 40 # Display detailed usage info (there are many options). |
| 41 tools/binary_size/diagnose_bloat.py -h | 41 tools/binary_size/diagnose_bloat.py -h |
| 42 | 42 |
| 43 ## Super Size | 43 ## Super Size |
| 44 | 44 |
| 45 Collect, archive, and analyze Chrome's binary size. | 45 Collect, archive, and analyze Chrome's binary size. |
| 46 Supports Android and Linux (although Linux | 46 Supports Android and Linux (although Linux |
| 47 [has issues](https://bugs.chromium.org/p/chromium/issues/detail?id=717550)). | 47 [has issues](https://bugs.chromium.org/p/chromium/issues/detail?id=717550)). |
| 48 | 48 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 1. Diffing | 106 1. Diffing |
| 107 | 107 |
| 108 * Some heuristics for matching up before/after symbols. | 108 * Some heuristics for matching up before/after symbols. |
| 109 | 109 |
| 110 ### Usage: `archive` | 110 ### Usage: `archive` |
| 111 | 111 |
| 112 Collect size information and dump it into a `.size` file. | 112 Collect size information and dump it into a `.size` file. |
| 113 | 113 |
| 114 *** note | 114 *** note |
| 115 **Note:** Refer to | 115 **Note:** Refer to |
| 116 [diagnose_bloat.py](https://cs.chromium.org/search/?q=file:diagnose_bloat.py+gn_
args) | 116 [diagnose_bloat.py](https://cs.chromium.org/search/?q=file:diagnose_bloat.py+gn_
args) |
| 117 for list of GN args to build a Release binary. | 117 for list of GN args to build a Release binary. |
| 118 *** | 118 *** |
| 119 | 119 |
| 120 Example: | 120 Example: |
| 121 | 121 |
| 122 ninja -C out/Release -j 1000 apks/ChromePublic.apk | 122 ninja -C out/Release -j 1000 apks/ChromePublic.apk |
| 123 tools/binary_size/supersize archive chrome.size --apk-file out/Release/apks/
ChromePublic.apk -v | 123 tools/binary_size/supersize archive chrome.size --apk-file out/Release/apks/
ChromePublic.apk -v |
| 124 | 124 |
| 125 # Linux: | 125 # Linux: |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 * Able to render size diffs (tint negative size red). | 184 * Able to render size diffs (tint negative size red). |
| 185 * Break down by other groupings (Create from result of `SplitByName()`) | 185 * Break down by other groupings (Create from result of `SplitByName()`) |
| 186 * Render as simple tree view rather than 2d boxes | 186 * Render as simple tree view rather than 2d boxes |
| 187 | 187 |
| 188 1. Integrate with `resource_sizes.py` so that it tracks size of major | 188 1. Integrate with `resource_sizes.py` so that it tracks size of major |
| 189 components separately: chrome vs blink vs skia vs v8. | 189 components separately: chrome vs blink vs skia vs v8. |
| 190 1. Add dependency graph info, perhaps just on a per-file basis. | 190 1. Add dependency graph info, perhaps just on a per-file basis. |
| 191 | 191 |
| 192 * No idea how to do this, but Windows can do it via `tools\win\linker_verbose_
tracking.py` | 192 * No idea how to do this, but Windows can do it via `tools\win\linker_verbose_
tracking.py` |
| OLD | NEW |