Deep-Diving Android Performance with Perfetto
summary
Perfetto recording workflows cover device developer tools, the web UI recorder and CLI automation (usable in CI) and target capture via traceur/adb/Jetpack recorder; traces include CPU, GPU, frace and binder events. Examples show a 250 ms first frame with a 190 ms recomposer and repeated GPU-completion waits plus a binder transaction appearing 83 times; root causes come from matching thread states, CPU core scheduling and custom markers created with the beginAsync/end trace API, making slow startups and jank evidence-based and actionable.
AI-written summary · about
chapters (27)
- 0:00Introduction
- 1:06Why app performance matters
- 2:28Profiling tools: Android Studio vs Perfetto
- 3:53Perfetto benefits over built-in tools
- 5:18Recording Perfetto trace
- 6:45Configuring Perfetto trace
- 8:09Perfetto trace structure
- 10:23Navigating Perfetto traces
- 12:32Startup breakdown analysis
- 14:01Pinning threads for comparison
- 15:50Main thread and frame rendering
- 17:17Gaps and GPU wait times
- 19:06Custom instrumentation in traces
- 20:54Trace API best practices
- 22:01Custom instrumentation with system traces
- 23:25Diagnosing janky frames
- 24:47Frame timelines: expected vs actual
- 25:51Causes of janky frames
- 26:57Jetpack Compose traces deep dive
- 28:40Trace slices for UI content
- 30:26First frame rendering optimization
- 31:29Binder transactions analysis
- 32:54Thread states and CPU scheduling
- 34:59Avoiding buffer size issues
- 35:44Searching traces efficiently
- 37:32Key takeaways
- 38:18Conclusion
related talks
13mPerfetto Your App for Perfect Performance
35mIn Search of Performance: the Subtle Art of Android Profiling
38mA Busy Android App Developers' Guide to Perfetto
43mAdvanced System Profiling Tracing and Trace Analysis with Perfetto
34mClient Tracing At Scale
40mDebugging Android Performance at Scale: Lessons from Building Datadog's Mobile Profiler
44mPAPA: Performance of Android Production Applications
43mBenchmarking your application
