Find the cause of UI jank in a recorded trace
언제 쓸까: User report: 'the app stutters when I scroll'. You captured a Perfetto trace. Now what?
사전 조건
- Perfetto .pftrace file — perfetto / systrace / Android Studio Profiler
흐름
-
Point MCP at the traceOpen /tmp/jank.pftrace for process com.example.app. Find jank frames — anything over 16.67ms on the main thread.✓ 복사됨→ 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?✓ 복사됨→ Cause per frame
-
Propose fixBased on these bottlenecks, suggest concrete changes (move off main, cache, etc.).✓ 복사됨→ Fix plan
결과: Jank root cause identified without staring at the timeline UI.
함정
- Sample interval too coarse — missing short hot methods — Re-record with higher sampling frequency when needed