Collect, archive, and analyze Chrome's binary size.
Collect size information and dump it into a .size
file. Mainly consists of symbol information parsed from a linker .map file.
# Android: # Googlers: gn gen out/Release --args='is_official_build=true symbol_level=1 is_chrome_branded=true target_os="android"' # Non-Googlers: gn gen out/Release --args='is_official_build=true symbol_level=1 exclude_unwind_tables=true ffmpeg_branding="Chrome" proprietary_codecs=true target_os="android"' ninja -C out/Release -j 1000 libchrome.so tools/binary_size/supersize archive chrome.size --elf-file out/Release/lib.unstripped/libchrome.so -v # Linux: LLVM_DOWNLOAD_GOLD_PLUGIN=1 gclient runhooks # One-time download. # Googlers: gn gen out/Release --args='is_official_build=true symbol_level=1 is_chrome_branded=true' # Non-Googlers: gn gen out/Release --args='is_official_build=true symbol_level=1 exclude_unwind_tables=true ffmpeg_branding="Chrome" proprietary_codecs=true' ninja -C out/Release -j 1000 chrome tools/binary_size/supersize archive chrome.size --elf-file out/Release/chrome -v
Creates an interactive size breakdown (by source path) as a stand-alone html report.
tools/binary_size/supersize html_report chrome.size --report-dir size-report -v xdg-open size-report/index.html
Starts a Python interpreter where you can run custom queries.
# Prints size infomation and exits (does not enter interactive mode). tools/binary_size/supersize console chrome.size --query='Print(size_info)' # Enters a Python REPL (it will print more guidance). tools/binary_size/supersize console chrome.size
A convenience command equivalent to: console before.size after.size --query='Print(Diff(size_info1, size_info2))'
tools/binary_size/supersize diff before.size after.size --all
Determine the cause of binary size bloat for a patch.
# Build and diff HEAD^ and HEAD. tools/binary_size/diagnose_apk_bloat.py HEAD # Diff OTHERREV and REV using downloaded build artifacts. tools/binary_size/diagnose_apk_bloat.py REV --reference-rev OTHERREV --cloud # Build and diff contiguous revs in range OTHERREV..REV for src/v8. tools/binary_size/diagnose_apk_bloat.py REV --reference-rev OTHERREV --subrepo v8 --all # Display detailed usage info (there are many options). tools/binary_size/diagnose_apk_bloat.py -h
Tracked in https://crbug.com/681694
archive
features:console
features:html_report
features:SymbolGroups
)resource_sizes.py
so that it tracks size of major components separately: chrome vs blink vs skia vs v8.diagnose_apk_bloat.py
features: