Android performance profiler
Skill Desquared/agents-rules-skills/skills/android-performance-profiler
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.From its SKILL.md
npx -y skills add Desquared/agents-rules-skills --skill android-performance-profilerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.2 KB, as published. Nobody here has run it
Performance Profiler (Android)
Checklist
Recompositions
- Composables only recompose when state changes
- State properly scoped with
remember - Stable item keys in LazyColumn
- Annotate custom data classes with
@Stableor@Immutable - Defer state reads (wrap in lambdas where possible)
- Avoid backwards writes (never write to a state that was already read higher in the same composable)
Lists
- Use
LazyColumnnotColumn + verticalScrollfor large data - Stable keys via
key()parameter - Lightweight item composables
Memory
- No memory leaks (avoid Activity/View refs)
- Use Coil/Glide for image loading with caching
- Proper lifecycle management
Body Computation
- No heavy work in composable body
- Use
rememberfor expensive calculations - Use
derivedStateOffor derived state
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