The Subtle Art of Profiling Android Apps
summary
Local profiling workflow for Android apps that reproduces issues on a real device using a release profilable build then records traces with Perfetto (ui.prof.dev) and a ring buffer to find the timeline boundaries; inspect thread states to spot sleeping or runnable main thread time, correlate with CPU-by-thread to find offending threads, use Android Studio sampling call stacks and flame graphs to reveal a huge SharedPreferences payload blocking startup (hundreds of MB causing seconds of wait) and GC-driven jank seen via the heap daemon, with scrcpy recommended for frame‑by‑frame video.
AI-written summary · about
chapters (14)
- 0:00Introduction and setup
- 3:00Keep it real profiling rules
- 7:29Screen recording with strrcpy
- 10:16Introducing Perfetto
- 13:51Recording a Perfetto trace
- 18:29Analyzing thread states in Perfetto
- 23:22CPU by thread correlation
- 24:24Android Studio CPU sampling
- 26:28Flame graphs for startup issues
- 28:12Jank analysis with Perfetto
- 31:02Memory and GC investigation
- 32:48Async sections for UI flows
- 34:35Thread correlation in complex flows
- 35:38Summary and methodology
related talks
35mIn Search of Performance: the Subtle Art of Android Profiling
46mProfiling with Examples: Hunting the Bottleneck
41mDeep dive into Android Studio Profilers
37mThe Art of Hiding Sensitive Info in Plain Sight
16mAndroid Studio Profiler Discovery
27mTest and profile Android applications with Qt
36mRevisiting Stealthy Sensitive Information Collection from Android Apps
34mSecuring Android: Tackling Advanced Threats and Enhancing App Security
