compose-performance-audit

Identify performance bottlenecks in Jetpack Compose UIs and propose fixes.

8|1|Updated Jun 12, 2018
One-click install
npx skills add https://github.com/SheTieJun/BaseKit --skill compose-performance-audit-shetiejun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-performance-audit
Source: https://github.com/SheTieJun/BaseKit/tree/main/.trae/skills/compose-performance-audit
Command: npx skills add https://github.com/SheTieJun/BaseKit --skill compose-performance-audit-shetiejun

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Jetpack Compose performance issues like slow rendering, jank, and excessive recompositions hinder user experience. This Skill provides a structured audit workflow to identify root causes and guide practical improvements.

Core Features & Use Cases

  • Code-First Review: Inspect target composables, state flow, and memory allocations to pinpoint hotspots.
  • Profiling Guidance: Recommend instrumentation with Layout Inspector, Perfetto, and macrobenchmarks to collect metrics and validate fixes.
  • Remediation Guidance: Propose concrete optimizations such as remember, stable keys, and size-bounded image loading for smoother scrolling.
  • Use Case: You have a screen with a long LazyColumn and frequent recompositions; apply this audit to reduce frame drops and improve smoothness.

Quick Start

Provide a target Compose snippet and, if possible, a Layout Inspector dump to begin the audit.

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 Jetpack Compose recomposition hotspots causing UI jank?

To fix Jetpack Compose recomposition hotspots causing UI jank, audit your composables for unnecessary state reads and apply concrete remediations like using `remember` and stable keys to prevent excessive rebuilds.

What causes excessive recompositions in a Compose LazyColumn?

Excessive recompositions in a Compose LazyColumn are typically caused by unstable item keys and unbounded state reads. Identifying these hotspots through a code-first review helps pinpoint memory allocation issues and guide practical improvements for smoother scrolling.

How do I profile Android Compose rendering and layout performance?

To profile Android Compose rendering and layout performance, use Layout Inspector and Perfetto to collect metrics. Instrumentation with macrobenchmarks helps validate fixes by measuring frame drops across layout and rendering paths.

When should I use remember in Jetpack Compose to optimize performance?

You should use `remember` in Jetpack Compose to optimize performance when a composable frequently recalculates values during recomposition. Applying `remember` stores the calculation result across recompositions, reducing overhead and mitigating slow rendering.

Does the Compose performance audit workflow require a Layout Inspector dump?

The Compose performance audit workflow does not strictly require a Layout Inspector dump but benefits from one. Providing a target Compose snippet alongside a dump allows for more accurate root-cause analysis of rendering and layout bottlenecks.

What is the best way to reduce frame drops in Jetpack Compose?

The best way to reduce frame drops in Jetpack Compose is a structured audit workflow that combines code review of state flow with profiling diagnostics. This approach yields actionable fixes like efficient image loading and stable keys to improve smoothness.