compose-performance-audit

Analyze Jetpack Compose code and profiling data to diagnose UI performance issues.

10.4k|519|Updated Apr 15, 2023
One-click install
npx skills add https://github.com/maxrave-dev/SimpMusic --skill compose-performance-audit-maxrave-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-performance-audit
Source: https://github.com/maxrave-dev/SimpMusic/tree/main/.claude/skills/compose-performance-audit
Command: npx skills add https://github.com/maxrave-dev/SimpMusic --skill compose-performance-audit-maxrave-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses performance bottlenecks in Jetpack Compose UI, such as jank, slow rendering, and excessive recompositions, by analyzing code and profiling data.

Core Features & Use Cases

  • Code Review: Analyzes composable functions for common performance anti-patterns like unstable parameters, missing remember, and inefficient state handling.
  • Profiling Guidance: Guides users on collecting performance data using Android Studio's Layout Inspector and Perfetto traces.
  • Root Cause Analysis: Diagnoses performance issues based on provided code or profiling data.
  • Remediation: Offers concrete code fixes and refactoring suggestions to improve UI performance.
  • Use Case: A developer is experiencing stuttering during scrolling in a LazyColumn. They use this Skill to identify that the key parameter is missing, leading to unnecessary recompositions, and receive a corrected code snippet.

Quick Start

Use the compose-performance-audit skill to review the provided Composable code for performance issues.

Frequently Asked Questions about compose-performance-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix janky scrolling in a Jetpack Compose LazyColumn?

Identify excessive recompositions causing jank in Jetpack Compose by analyzing profiling data and code for missing `key` parameters in LazyColumn, then apply suggested refactoring to stabilize item rendering.

What causes excessive recompositions in Jetpack Compose UI?

Excessive recompositions in Jetpack Compose are caused by unstable parameters, missing `remember` calls, and inefficient state handling, which you can diagnose by auditing composable functions and analyzing profiling data.

How do I use Perfetto and Layout Inspector to profile Android Compose performance?

Profile Android Compose performance by collecting system traces with Perfetto and inspecting the recomposition lifecycle using Android Studio's Layout Inspector to pinpoint slow rendering and UI bottlenecks.

Can I audit Jetpack Compose state management for performance anti-patterns?

Yes, you can audit Jetpack Compose state management by analyzing composable functions to identify inefficient state handling and missing `remember` usage, providing concrete code fixes to improve UI performance.

Do I need Perfetto traces to diagnose slow rendering in Jetpack Compose?

Perfetto traces are not strictly required to diagnose slow rendering in Jetpack Compose, as code analysis can identify anti-patterns, but profiling data provides deeper root cause analysis for UI bottlenecks.