Baseline Profiles
Give the critical path a head start
Normally, Kotlin/Java bytecode is interpreted at first, and only JIT-compiled (just-in-time, to native machine code) after it's been run often enough to be worth optimizing. That's fine for code that runs constantly β but it means the very first launch, or the first scroll through the walker list, runs on slow, uncompiled code, right when a walker's first impression is being made.
A Baseline Profile is a list of classes and methods your app's critical paths use, shipped inside the app as baseline-prof.txt. On install, Android ahead-of-time (AOT) compiles exactly those methods, so the first launch and first scroll are already running compiled code instead of starting cold. It's a real, measurable win on startup time and first-scroll jank β not a micro-optimization.
You don't write a Baseline Profile by hand β you generate it by running a Macrobenchmark test that exercises the real user journey (launch the app, scroll the walker list) on a device, using BaselineProfileRule. The rule records which methods actually ran during that journey and writes them out as the profile.