Investigate cruncherEnabled for AAPT PNG optimization

NEW
Assigned to

Status

()

3 years ago
3 years ago

People

(Reporter: mcomella, Assigned: k.krish, Mentored)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Sebastian pointed out an article:
  https://medium.com/@duhroach/smaller-pngs-and-android-s-aapt-tool-4ce38a24019d#.ukj81d97r

It mentions that AAPT's optimization tool can actually increase the size of PNGs if you've already optimized your PNGs beforehand (which we do). You can disable the functionality with the "cruncherEnabled" flag. We should:
 * See what's currently running
 * Investigate twiddling the flag
 * See how it affects the produced APK

Note: who knows what moz.build is doing but let's focus on gradle because we'll drop moz.build (hopefully) soon.
Thanks for filing this!
Mentor: michael.l.comella, s.kaspari
Hey Krish. This is not directly related to downloadable content but APK size.

Can you build with gradle (front-end build) and compare the APK size with cruncherEnabled on/off (See blog posting in comment 0). Almost all our PNGs are optimized (see bug 1266057), so we are wondering if aapt will actually increase the size of the APK.
Assignee: nobody → k.krish
(Assignee)

Comment 3

3 years ago
Hey Sebastian,

Sure I will perform the necessary investigations and come back.
We were just talking about this on IRC and with a fx-team gradle build we see a ~100KB difference:
* Default build: 39240639 bytes
* With cruncher disabled: 39128721 bytes
(-111918 bytes / ~109KB)
(Assignee)

Comment 5

3 years ago
I built the code in my local machine and observed the following.

* Default Build - 3,93,53,420 bytes.
* With Cruncher disabled  - 3,92,41,478 bytes.

*Difference = 1,11,942 bytes which is - ~111KB.
Great. This matches my observations.

It would be interesting to know if we can disable this when running aapt manually (I think that's what our mach based build does) or if this is only available to gradle based builds.
You need to log in before you can comment on or make changes to this bug.