Search code examples
androidandroid-jetpack-composebenchmarkingandroid-jetpackbaseline-profile

How to activate Baseline Profiles - Android?


I generated Baseline Profiles and saw promising results in my Macrobenchmark test: enter image description here

I put the baseline-prof.txt file in the main folder next to the Manifest.xml. When I run the app in release mode I cannot see a visible difference when performing the action I generated the baseline profile for.

Can I only see the benefit of baseline profiles when installing the app via Google Play store? Am I missing something?

Also what do those P50, P90, P95 mean? The docs say: “These measurements are collected in distribution: 50th, 90th, 95th, and 99th percentile.”

Not sure what that means


Solution

  • Correct, baseline profiles are not used when running locally. It is possible to manually side load one but using Macrobenchmark like you are doing is much easier.

    P50 etc is a statistical distribution of your measured results. You can read it like

    P90 means 90% of cases were measured to be better than this. Or inversely 10% of cases were worse.