New issue
Advanced search Search tips

Issue 698733 link

Starred by 3 users

Issue metadata

Status: Assigned
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Show other hotlists

Hotlists containing this issue:

Sign in to add a comment

[meta] Reduce the size of machine code using line number table from debug info (using bloaty)

Project Member Reported by, Mar 6 2017

Issue description

Let's see how much machine code is generated in for each debugger-step-able source line of code.

Proposing to link to this issue all patches/CLs based on insights like this.

To dump per-line size info for the top 1000 lines:
1) Download & build bloaty from
2) Build with is_official_build=true
3) Run: bloaty --debug-file out/Release/lib.unstripped/ -n 1000 -s file -w -d inlines out/Release/ > inlines.txt

Note: Another new tool popped up that seems similar:
Labels: binay-size
Some additional (Googler-only for now) context on what this means:

Comment 3 by, Mar 30 2017

Labels: -binay-size Binary-Size
Project Member

Comment 4 by, Mar 31 2017

The following revision refers to this bug:

commit 7231325cc8642ceebcff903a590d3dccab5d7e65
Author: pasko <>
Date: Fri Mar 31 13:49:51 2017

Prerender: Remove PerceivedPLT histograms

* We stopped looking at this class of metrics
* It saves 5320 bytes of the code size on Android (see below)
* Saves multi-GiB of data on UMA servers

Removing PerceivedPLT also made a bit of state unused, hence it was removed:
* PrerenderHistograms objects are now almost stateless
* PrerenderTabHelper now only manages origin_, url_ and swap_ticks_

To confirm the binary size change:
1. build chrome_apk with is_official_build = true
2. shell> find out/ReleaseOfficial/gen -name -exec size {} \;


Cr-Commit-Position: refs/heads/master@{#461105}


Labels: -binary-size Performance-Size
Project Member

Comment 6 by, Sep 6 2017

The following revision refers to this bug:

commit b2d8479c6d85a2d836bdaa340ec450f40c8627f4
Author: Egor Pasko <>
Date: Wed Sep 06 01:43:40 2017

Remove a few prerender histograms

This saves ~6.5 KiB of .text on Android by removing expansions of histogram
maros in A few macros were converted to their
counterparts from histogram_functions.h, others were removed as no longer

Cleanup of impossible paths leading to these calls (such as
ORIGIN_OFFLINE or ORIGIN_INSTANT) is postponed for future changes.

Histograms that could still be recorded with nostate-prefetch:

  * Can approximate sufficiently from FinalStatus.
  * Was not used in any of our recent analysis.
  * Recorded on iOS, not used in our recent analysis for
    desktop/Android, can approximate with FinalStatus.
  * Does not look actionable.

Swap-in cannot be triggered any more except with the AMP/CCT flow, where
it swaps over an empty/fake WebContents, which makes the following
histograms no longer interesting:

PercentLoadDoneAtSwapin, OmniboxNavigationsUsedPrerenderCount,
TimeUntilUsed2, AbandonTimeUntilUsed, NetworkBytesUsed.

Bug: 603203, 698733
Change-Id: I193e8748804f7653c676ad2bedd353af739b3b5e
Reviewed-by: Matthew Cary <>
Reviewed-by: Josh Karlin <>
Reviewed-by: Ilya Sherman <>
Commit-Queue: Egor Pasko <>
Cr-Commit-Position: refs/heads/master@{#499840}

Description: Show this description
Summary: [meta] Reduce the size of machine code using line number table from debug info (using bloaty) (was: [meta] Reduce the size of machine code using line number table from debug info)
Update initial comment & title to mention that this can be dumped via bloaty.
Attaching current top 2000.

Example output:
     VM SIZE                                                                                                                                                  FILE SIZE
 --------------                                                                                                                                            --------------
  56.3%  23.9Mi [1710958 Others]                                                                                                                            22.4Mi  54.7%
  20.0%  8.49Mi [Unmapped]                                                                                                                                  8.50Mi  20.7%
   0.6%   241Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/memory:2233                                                                241Ki   0.6%
   0.3%   126Ki ../../third_party/WebKit/Source/platform/wtf/text/WTFString.h:62                                                                             126Ki   0.3%
   0.3%   116Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/utility:437                                                                116Ki   0.3%
   0.3%   115Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/memory:2050                                                                115Ki   0.3%
   0.2%   101Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/vector:635                                                                 101Ki   0.2%
   0.2%  99.6Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/memory:2543                                                               99.6Ki   0.2%
   0.2%  92.6Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/memory:2544                                                               92.6Ki   0.2%
   0.2%  87.3Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/memory:3026                                                               87.3Ki   0.2%
   0.2%  82.3Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/memory:2515                                                               82.3Ki   0.2%
   0.2%  78.2Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/atomic:922                                                                78.2Ki   0.2%
   0.2%  77.1Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/memory:2545                                                               77.1Ki   0.2%
   0.2%  74.3Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/atomic:1017                                                               74.3Ki   0.2%
   0.2%  68.3Ki ../../v8/include/v8.h:9374                                                                                                                  68.3Ki   0.2%
   0.1%  63.6Ki ../../base/bind_internal.h:454                                                                                                              63.6Ki   0.2%
   0.1%  60.0Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/string:1239                                                               60.0Ki   0.1%
   0.1%  57.8Ki ../../third_party/android_ndk/sources/cxx-stl/llvm-libc++/include/type_traits:4458                                                          57.8Ki   0.1%
   0.1%  56.2Ki ../../base/bind_internal.h:211                                                                                                              56.2Ki   0.1%
   0.1%  55.4Ki ../../base/memory/scoped_refptr.h:200                                                                                                       55.4Ki   0.1%
   0.1%  52.7Ki ../../base/memory/scoped_refptr.h:209                                                                                                       52.7Ki   0.1%
   0.1%  51.9Ki ../../base/bind.h:242                                                                                                                       51.9Ki   0.1%
332 KB View Download

Comment 10 by, Jan 16 2018

with lnsdump I could see that after switch to clang a bunch of line numbers were pointing to 0 (clang not very careful in optimized code?), wondering if bloaty would observe the same ..

Comment 11 by, Jan 16 2018

Yeah, just click "view" on the attachment and search for :0 and you'll see there are lots of them. There are also many lines that point to "class Foo {", which might mean "generated code for this class", but that's just a guess.
Status: Assigned (was: Available)
Description: Show this description
--debug-file flag seems currently broken (filed

Attaching an updated inlines dump from today via:
bloaty out-gn/Release/lib.unstripped/ -n 1000 -s file -w -d sections,inlines >inlines-Oct-2018.txt
162 KB View Download

Sign in to add a comment