Find the cause of UI jank in a recorded trace
When to use: User report: 'the app stutters when I scroll'. You captured a Perfetto trace. Now what?
Prerequisites
- Perfetto .pftrace file — perfetto / systrace / Android Studio Profiler
Flow
-
Point MCP at the traceOpen /tmp/jank.pftrace for process com.example.app. Find jank frames — anything over 16.67ms on the main thread.✓ Copied→ List of janky frames with slice context
-
Attribute the causeFor the top 3 janky frames, what slice dominated? What was the main thread doing when the frame missed?✓ Copied→ Cause per frame
-
Propose fixBased on these bottlenecks, suggest concrete changes (move off main, cache, etc.).✓ Copied→ Fix plan
Outcome: Jank root cause identified without staring at the timeline UI.
Pitfalls
- Sample interval too coarse — missing short hot methods — Re-record with higher sampling frequency when needed