Ask where a performance figure in a roadmap deck came from. Often the honest answer is another deck. We found three such figures in our own engineering article on this subject this month, including a results table for a phone nobody had tested on. They are gone. What follows is what the vendor documents, and nothing else.
Two Tools That Work Below the Code
Most performance work means changing the product. Two tools do not. The first, a Baseline Profile, tells the phone which parts of the app to prepare before the customer opens it for the first time. Without one, Android says, users "have a suboptimal experience from the first time they run it until new code paths are optimized". With one, the documented effect is specific: "Baseline Profiles improve code execution speed by about 30% from the first launch by avoiding interpretation and just-in-time (JIT) compilation steps for included code paths" (Android).
The second is the optimizer that runs when a release is built. Google describes it as a tool that "streamlines your app by removing unused code and resources, rewriting code to optimize runtime performance, and more" (Android).
It Is Not On Unless Someone Turned It On
Teams often assume the optimizer runs by default. Google phrases it as an instruction: "You should always enable optimization for your app's release build". The gains also apply only to release builds. A team that judges performance on the debug version it uses every day is judging a different product from the one customers get.
Old Configuration Is a Liability
Optimizer settings are copied from project to project for years. Many no longer do anything. Google publishes the list of options the tool ignores silently, and its advice is direct: "Because they have no effect on R8 output, remove them from your proguard-rules.pro file to keep your configuration easier to understand and maintain." Other copied rules do worse than nothing. They switch optimization off for whole areas of the app, quietly, and nobody notices because nothing breaks.
What to Ask Your Team
- Is optimization enabled for our release build, and who checked?
- Do we ship a Baseline Profile, and when was it last regenerated? It should match the code in the release.
- Where did our performance numbers come from? A benchmark on a real device, or a slide.
- When did someone last read the optimizer rules file? If the answer is never, it is carrying dead weight.
-Rocky
#MobilePerformance #Android #EngineeringQuality #EngineeringDreams #StrategiaX
Originally published on ANDROID-ARCHITECT, the Android engineering blog of Strategia-X, with the configuration and the benchmark code.
