| name | android-performance-profiler |
| description | Identifies potential performance bottlenecks in Jetpack Compose code including expensive recompositions, unnecessary redraws, and memory issues. Use when code involves lists, animations, complex UI, or when the user asks about performance optimization. |
Performance Profiler (Android)
Checklist
Recompositions
Lists
Memory
Body Computation
Quick Wins
| Issue | Fix |
|---|
| Parent recomposes | Extract stable child composables |
| Expensive body | Use remember or derivedStateOf |
| Unstable IDs | Use stable keys in LazyColumn |
| Memory leak | Avoid storing Activity/View references |
| Broad recomposition | Narrow state scope |
| Unstable custom types causing broad recompositions | Add @Stable/@Immutable |
| Backwards write or immediate state read | Defer with lambda or derivedStateOf |
Debug
Use Layout Inspector → Recomposition Counts to visualize recompositions
Use Compose Compiler Metrics report (stability analysis)
Enable Composition Tracing in Layout Inspector
Severity
- 🔴 Critical: Visible lag, leaks
- 🟡 Moderate: Noticeable impact
- 🟢 Minor: Optimization opportunity