| OLD | NEW |
| 1 # map2size.py | 1 # Tools for analyzing Chrome's binary size |
| 2 | 2 |
| 3 Parses a linker .map file and outputs the result as a .size file. | 3 # Super Size |
| 4 | 4 |
| 5 ## Example Usage: | 5 Collect, archive, and analyze Chrome's binary size. |
| 6 |
| 7 ## "archive" |
| 8 |
| 9 Collect size information and dump it into a `.size` file. Mainly consists of |
| 10 symbol information parsed from a linker .map file. |
| 11 |
| 12 ### Example Usage: |
| 6 | 13 |
| 7 # Android: | 14 # Android: |
| 8 gn gen out/Release --args='target_os="android" is_official_build=true' | 15 gn gen out/Release --args='target_os="android" is_official_build=true' |
| 9 ninja -C out/Release -j 1000 libchrome.so | 16 ninja -C out/Release -j 1000 libchrome.so |
| 10 tools/binary_size/map2size.py out/Release/lib.unstripped/libchrome.so chrome
.size -v | 17 tools/binary_size/supersize archive chrome.size --elf-file out/Release/lib.u
nstripped/libchrome.so -v |
| 11 # Linux: | 18 # Linux: |
| 12 gn gen out/Release --args='is_official_build=true' | 19 gn gen out/Release --args='is_official_build=true' |
| 13 ninja -C out/Release -j 1000 chrome | 20 ninja -C out/Release -j 1000 chrome |
| 14 tools/binary_size/map2size.py out/Release/chrome chrome.size -v | 21 tools/binary_size/supersize archive chrome.size --elf-file out/Release/chrom
e -v |
| 15 | 22 |
| 16 # create_html_breakdown.py | 23 ## "html_report" |
| 17 | 24 |
| 18 Creates an interactive size breakdown as a stand-alone html report. | 25 Creates an interactive size breakdown (by source path) as a stand-alone html |
| 26 report. |
| 19 | 27 |
| 20 ## Example Usage: | 28 ## Example Usage: |
| 21 | 29 |
| 22 tools/binary_size/create_html_breakdown.py chrome.size --report-dir size-rep
ort -v | 30 tools/binary_size/supersize html_report chrome.size --report-dir size-report
-v |
| 23 xdg-open size-report/index.html | 31 xdg-open size-report/index.html |
| 24 | 32 |
| 25 # console.py | 33 ## "console" |
| 26 | 34 |
| 27 Starts a Python interpreter where you can run custom queries. | 35 Starts a Python interpreter where you can run custom queries. |
| 28 | 36 |
| 29 ## Example Usage: | 37 ## Example Usage: |
| 30 | 38 |
| 31 # Runs a single diff and exits (does not enter interactive mode). | 39 # Runs a single diff and exits (does not enter interactive mode). |
| 32 tools/binary_size/console.py without_patch.size with_patch.size --query='Dif
f(size_info2, size_info1)' | 40 tools/binary_size/supersize console without_patch.size with_patch.size --que
ry='Diff(size_info2, size_info1)' |
| 33 | 41 |
| 34 # Enters a Python REPL (it will print more guidance). | 42 # Enters a Python REPL (it will print more guidance). |
| 35 tools/binary_size/console.py chrome.size | 43 tools/binary_size/supersize console chrome.size |
| 36 | 44 |
| 37 # diagnose_apk_bloat.py | 45 ## diagnose_apk_bloat.py |
| 38 | 46 |
| 39 Determine the cause of binary size bloat for a patch. | 47 Determine the cause of binary size bloat for a patch. |
| 40 | 48 |
| 41 ## Example Usage: | 49 ### Example Usage: |
| 42 | 50 |
| 43 # Sync, build, and store MonochromePublic.apk for HEAD and HEAD^. | 51 # Sync, build, and store MonochromePublic.apk for HEAD and HEAD^. |
| 44 tools/binary_size/diagnose_apk_bloat.py -v | 52 tools/binary_size/diagnose_apk_bloat.py -v |
| 45 | 53 |
| 46 # Display detailed usage info (there are many options). | 54 # Display detailed usage info (there are many options). |
| 47 tools/binary_size/diagnose_apk_bloat.py -h | 55 tools/binary_size/diagnose_apk_bloat.py -h |
| 48 | 56 |
| 49 # Roadmap: | 57 # Roadmap for Super Size: |
| 50 | 58 |
| 51 Tracked in https://crbug.com/681694 | 59 Tracked in https://crbug.com/681694 |
| 52 | 60 |
| 53 1. More console.py features: | 61 1. More `archive` features: |
| 54 * Template Symbols - shows when templates lead to code bloat. | 62 |
| 55 * Duplicate Symbols - shows when statics in headers are an issue. | 63 * Find out more about 0xffffffffffffffff addresses, and why such large |
| 56 * Overloaded Symbols - shows when overloads are excessive. | 64 gaps exist after them. |
| 57 * Per-class / namespace size (no way to distinguish class vs namespace). | 65 * Use nm to get the full list of symbols that share the same address. |
| 58 * Per-Chrome package (Chrome-specific grouping. e.g. name prefixes). | 66 * Collect java symbol information |
| 59 * CSV output (for pasting into a spreadsheet). | 67 * Collect .pak file information (using .o.whitelist files) |
| 60 1. More create_html_breakdown.py features: | 68 * Collect .apk entry information |
| 61 * Break down by other groupings (e.g. create from nested `SymbolGroups`) | 69 |
| 62 1. More `map2size.py` features: | 70 1. More `console` features: |
| 63 * Find out more about 0xffffffffffffffff addresses, and why such large | 71 |
| 64 gaps exist after them. | 72 * Template Symbols - shows when templates lead to code bloat. |
| 65 * Use nm to get the full list of symbols that share the same address. | 73 * Duplicate Symbols - shows when statics in headers are an issue. |
| 66 1. More diagnose_apk_bloat.py features: | 74 * Overloaded Symbols - shows when overloads are excessive. |
| 67 * Add diffing functionality to see diff stats for two commits. | 75 * Per-class / namespace size (no way to distinguish class vs namespace). |
| 68 * Add --cloud option for using artifacts from perf builders. | 76 * Per-Chrome package (Chrome-specific grouping. e.g. name prefixes). |
| 69 1. Integrate with `resource_sizes.py` so that it tracks size of major | 77 * CSV output (for pasting into a spreadsheet). |
| 70 components separately: chrome vs blink vs skia vs v8. | 78 |
| 71 1. Speed up some steps (like normalizing names) via multiprocessing. | 79 1. More `html_report` features: |
| 72 1. Use resource whitelist information to attribute .pak file size to .o files. | 80 |
| 73 1. Add dependency graph info, perhaps just on a per-file basis. | 81 * Break down by other groupings (e.g. create from nested `SymbolGroups`) |
| 82 |
| 83 1. Integrate with `resource_sizes.py` so that it tracks size of major |
| 84 components separately: chrome vs blink vs skia vs v8. |
| 85 1. Speed up some steps (like normalizing names) via multiprocessing. |
| 86 1. Add dependency graph info, perhaps just on a per-file basis. |
| 87 |
| 88 # Roadmap for diagnose_apk_bloat.py: |
| 89 1. More `diagnose_apk_bloat.py` features: |
| 90 |
| 91 * Add diffing functionality to see diff stats for two commits. |
| 92 * Add --cloud option for using artifacts from perf builders. |
| OLD | NEW |