New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 733307 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Grouped diffs for diagnose_bloat.py

Project Member Reported by wnwen@chromium.org, Jun 14 2017

Issue description

It would be nice to have numbers that sum up to parent numbers, i.e.

+50kb - uncompressed apk size
   +30kb - translation
   +10kb - pngs
   +9kb - drawables
   +1kb - methods and fields
+20kb - tranfser size
   +12kb - translation
   +5kb - pngs
   +3kb - drawables
   +0kb - methods and fields

Instead of currently:
Details:
   +51,739 bytes MonochromePublic.apk_Specifics normalized apk size
   +26,736 bytes MonochromePublic.apk_InstallSize Estimated installed size
   +21,572 bytes MonochromePublic.apk_InstallSize APK size
    +8,040 bytes MonochromePublic.apk_Uncompressed Compiled Android resources size
    +8,040 bytes MonochromePublic.apk_Breakdown Compiled Android resources size
    +8,040 bytes MonochromePublic.apk_InstallBreakdown Compiled Android resources size
    +7,125 bytes MonochromePublic.apk_InstallBreakdown Java code size
    +6,671 bytes MonochromePublic.apk_Uncompressed PNG drawables size
    +6,671 bytes MonochromePublic.apk_Breakdown PNG drawables size
    +6,671 bytes MonochromePublic.apk_InstallBreakdown PNG drawables size
    +5,164 bytes MonochromePublic.apk_Uncompressed Java code size
    +5,164 bytes MonochromePublic.apk_Specifics main dex size
    +3,973 bytes MonochromePublic.apk_TransferSize Transfer size (deflate)
    +2,208 bytes MonochromePublic.apk_Uncompressed Non-compiled Android resources size
    +2,152 bytes MonochromePublic.apk_Uncompressed Package metadata size
    +1,961 bytes MonochromePublic.apk_Breakdown Java code size
      +950 bytes MonochromePublic.apk_Breakdown Non-compiled Android resources size
      +950 bytes MonochromePublic.apk_InstallBreakdown Non-compiled Android resources size
      +686 bytes MonochromePublic.apk_Breakdown Package metadata size
      +686 bytes MonochromePublic.apk_InstallBreakdown Package metadata size
      +452 bytes MonochromePublic.apk_DexCache DexCache
      +108 bytes MonochromePublic.apk_MainLibInfo text
       +45 entries MonochromePublic.apk_Dex methods
       +35 entries MonochromePublic.apk_Dex strings
       +28 entries MonochromePublic.apk_Dex fields
       +12 zip entries MonochromePublic.apk_Specifics file count
        +5 entries MonochromePublic.apk_Dex types
 
Just had a run that looked like:
Summary:
Normalized APK size: -12,288 bytes

Details:
   -51,182 bytes MonochromePublic.apk_Uncompressed licenses.notice file size
   -20,480 bytes MonochromePublic.apk_InstallSize Estimated installed size
   -16,384 bytes MonochromePublic.apk_InstallBreakdown Native code size
   -12,288 bytes MonochromePublic.apk_InstallSize APK size
   -12,288 bytes MonochromePublic.apk_Specifics normalized apk size
    -8,192 bytes MonochromePublic.apk_Uncompressed Native code size
    -8,192 bytes MonochromePublic.apk_Breakdown Native code size
    -8,192 bytes MonochromePublic.apk_Specifics main lib size
    -5,812 bytes MonochromePublic.apk_MainLibInfo text
    -4,223 bytes MonochromePublic.apk_Breakdown licenses.notice file size
    -4,223 bytes MonochromePublic.apk_InstallBreakdown licenses.notice file size
    -2,101 bytes MonochromePublic.apk_Uncompressed Native resources (no l10n) size
    -2,101 bytes MonochromePublic.apk_Breakdown Native resources (no l10n) size
    -2,101 bytes MonochromePublic.apk_InstallBreakdown Native resources (no l10n) size
        +8 bytes MonochromePublic.apk_Breakdown Package metadata size
        +8 bytes MonochromePublic.apk_InstallBreakdown Package metadata size
        +7 bytes MonochromePublic.apk_TransferSize Transfer size (deflate)
        +0 bytes MonochromePublic.apk_Uncompressed ICU (i18n library) data size
        +0 bytes MonochromePublic.apk_Uncompressed Unknown files size
        +0 bytes MonochromePublic.apk_Uncompressed Non-compiled Android resources size
        +0 bytes MonochromePublic.apk_Uncompressed Native resources (l10n) size
        +0 bytes MonochromePublic.apk_Uncompressed V8 Snapshots size
        +0 bytes MonochromePublic.apk_Uncompressed PNG drawables size
        +0 bytes MonochromePublic.apk_Uncompressed Package metadata size
        +0 bytes MonochromePublic.apk_Uncompressed Java code size
        +0 bytes MonochromePublic.apk_Uncompressed Compiled Android resources size
        +0 bytes MonochromePublic.apk_MainLibInfo unwind
        +0 bytes MonochromePublic.apk_MainLibInfo relocations
        +0 bytes MonochromePublic.apk_MainLibInfo bss
        +0 bytes MonochromePublic.apk_MainLibInfo symbols
        +0 bytes MonochromePublic.apk_MainLibInfo other
        +0 bytes MonochromePublic.apk_MainLibInfo data
        +0 bytes MonochromePublic.apk_Breakdown ICU (i18n library) data size
        +0 bytes MonochromePublic.apk_Breakdown Unknown files size
        +0 bytes MonochromePublic.apk_Breakdown Non-compiled Android resources size
        +0 bytes MonochromePublic.apk_Breakdown Native resources (l10n) size
        +0 bytes MonochromePublic.apk_Breakdown V8 Snapshots size
        +0 bytes MonochromePublic.apk_Breakdown PNG drawables size
        +0 bytes MonochromePublic.apk_Breakdown Java code size
        +0 bytes MonochromePublic.apk_Breakdown Compiled Android resources size
        +0 bytes MonochromePublic.apk_InstallBreakdown ICU (i18n library) data size
        +0 bytes MonochromePublic.apk_InstallBreakdown Unknown files size
        +0 bytes MonochromePublic.apk_InstallBreakdown Non-compiled Android resources size
        +0 bytes MonochromePublic.apk_InstallBreakdown Native resources (l10n) size
        +0 bytes MonochromePublic.apk_InstallBreakdown V8 Snapshots size
        +0 bytes MonochromePublic.apk_InstallBreakdown PNG drawables size
        +0 bytes MonochromePublic.apk_InstallBreakdown Java code size
        +0 bytes MonochromePublic.apk_InstallBreakdown Compiled Android resources size
        +0 zip entries MonochromePublic.apk_Specifics file count
        +0 bytes MonochromePublic.apk_Specifics secondary dex size
        +0 bytes MonochromePublic.apk_Specifics main dex size
        +0 bytes MonochromePublic.apk_Specifics other lib size
        +0 bytes MonochromePublic.apk_DexCache DexCache
        +0 entries MonochromePublic.apk_Dex fields
        +0 entries MonochromePublic.apk_Dex methods
        +0 entries MonochromePublic.apk_Dex types
        +0 entries MonochromePublic.apk_Dex strings



Rather than show both summary and detailed diff in the console, I think we should:

Show only the summary in the console, and write only the detailed diff to the file.

For the resource_sizes diff, we should make the summary include only "Breakdown" and "Specifics" metrics, and only those that are non-zero.

For the native diff, the summary should just be the truncated output.
Owner: estevenson@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d1dfb45a119293692e31ed824938dae44e4090f9

commit d1dfb45a119293692e31ed824938dae44e4090f9
Author: estevenson <estevenson@chromium.org>
Date: Fri Jun 23 17:36:45 2017

diagnose_bloat.py: Grouped diffs.

Adds grouping by section for resource_sizes diffs to make to diff
output easier to read. Removes summary from output diff file.

resource_sizes diff output:

MonochromePublic.apk_Breakdown (+17,441 bytes)
    +2,769 bytes Non-compiled Android resources size
    +8,712 bytes PNG drawables size
    +1,485 bytes Package metadata size
    +1,995 bytes Java code size
    +2,480 bytes Compiled Android resources size
MonochromePublic.apk_Specifics
   +25,038 bytes normalized apk size
       +20 zip entries file count
    +5,580 bytes main dex size

BUG= 733307 

Review-Url: https://codereview.chromium.org/2954043002
Cr-Commit-Position: refs/heads/master@{#481946}

[modify] https://crrev.com/d1dfb45a119293692e31ed824938dae44e4090f9/tools/binary_size/diagnose_bloat.py

Status: Fixed (was: Assigned)

Comment 5 by wnwen@chromium.org, Jun 26 2017

This is great! Thanks Eric!

Sign in to add a comment