generating-baseline-profiles
Generating Baseline Profiles — ship the AOT compilation hint list and prove it moved the needle
Baseline Profiles ship an AOT compilation hint list inside the APK so ART pre-compiles hot Compose code paths on install instead of relying on JIT during the first runs. Cited gains: roughly 30% faster cold startup and 40% smoother first-scroll on the journeys that were profiled. Compose ships unbundled from the platform, so every Compose UI app benefits — there is no version of Android where Compose is already AOT-compiled by the system image.
This skill is the measurement spine for the rest of the performance work. Profiles are generated with BaselineProfileRule from androidx.benchmark:benchmark-macro-junit4 and measured with MacrobenchmarkRule from the same artifact. Generation and measurement are two distinct @Test files in a separate :baselineprofile module that AGP 8.2+ scaffolds via New Module → Baseline Profile Generator.
When to use this skill
- Cold startup is slow and the developer wants AOT-compiled hot paths on first launch.
- First-scroll on a
LazyColumn/LazyVerticalGridis janky on real devices even after stability fixes. - Preparing a release build and the developer needs a perf baseline before shipping.
- Verifying that a stability or strong-skipping fix actually moved cold-startup or frame-timing numbers — Macrobenchmark is the ground truth.
- The user mentions "baseline profile", "macrobenchmark", "TTFD", "time-to-fully-drawn", "StartupTimingMetric", "FrameTimingMetric", "CompilationMode",
aosp_cf_x86_64_phone-userdebug, or "ReportDrawn".