Closed Bug 1670948 Opened 2 years ago Closed 2 years ago

Restore nightly android build optimization to -Oz (currently -O2)


(Firefox Build System :: Android Studio and Gradle Integration, task)



(firefox83 fixed)

83 Branch
Tracking Status
firefox83 --- fixed


(Reporter: acreskey, Assigned: acreskey)




(1 file)

In Bug 1591725 we considered at optimization at -O2 instead of -Oz.

The conclusion of the experiment was that we did not have sufficient evidence of an improvement in the wild to justify the increase in binary size.

Currently we still build nightly android at -O2.

This bug is to revert the nightly back to -Oz

In Bug 1591725 we looked at trade offs between the faster -O2 and the increased binary size.
We have decided to not ship this, so restoring -Oz level optimization to nightly android.

Attachment #9181317 - Attachment description: Bug 1670948 - Restore nightly android build optimization to -Oz (currently -O2) r= → Bug 1670948 - Restore nightly android build optimization to -Oz (currently -O2) r=dmajor
Pushed by
Restore nightly android build optimization to -Oz (currently -O2) r=dmajor
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Regressions: 1671551

Comment moved to regression bug Bug 1671153 - 3.16 - 3.59% compiler_metrics num_static_constructors (android-4-0-armv7-api16, android-5-0-aarch64, android-5-0-x86_64) regression on push 9a93d87ab951182265d06fcbc59fa835efd43ad5 (Wed October 14 2020)

Andrew, do you mind elaborating on what evidence we gathered and what changes we saw or didn't see?

Flags: needinfo?(acreskey)

Jeff, yes - let me find the data science analysis of the experiment.
The tl;dr is:
We ran an A/B experiment on large Fenix Preview populations. It was tricky to do A/B with different binaries, but a lot of care and effort when into this execution.

We have data from google that says that larger APK sizes reduce usage (one reason being that people are distracted during the longer download time and never run the app...)
So that's what we're balancing against.

In the results (we looked at performance and also engagement and retention metrics) we did not see any improvements with the faster, slightly larger -O2 binary.
And I believe certain metrics were slightly in the negative territory (but not quite statistically significantly so) with this optimized binary.

This doesn't go into the decision making, but it describes the changes observed:

I forgot that we did see gfx_content_paint_time improved ~12%

Jeff. let me know if you want more details on the build flag decision making, I may be able to find more documentation with more effort.

But we were in agreement at the time, just before Fenix launch, I believe, that this increase in binary size was not worth the risk.

I don't think this should close to door to future work in this area.
In particular, the -Os optimization, for size instead of aggressively for size, showed almost the same performance improvements with less of an apk bloat.
And of course we could find other ways to reduce the binary size.

But note that it's currently quite time-consuming to experiment on user populations with different binaries.

Another issue we discovered is that our observed performance gains from users did not match the improvements that we recorded in CI or in local testing.
This is an ongoing concern, in my opinion.

Flags: needinfo?(acreskey)
You need to log in before you can comment on or make changes to this bug.