tracing-recompositions-at-runtime

Instrument Jetpack Compose composables with @TraceRecomposition and emit per-recomposition details to logcat.

472|16|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/skydoves/compose-performance-skills --skill tracing-recompositions-at-runtime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tracing-recompositions-at-runtime
Source: https://github.com/skydoves/compose-performance-skills/tree/main/measurement/tracing-recompositions-at-runtime
Command: npx skills add https://github.com/skydoves/compose-performance-skills --skill tracing-recompositions-at-runtime

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps diagnose recompositions in Jetpack Compose by instrumenting composables with @TraceRecomposition from skydoves/compose-stability-analyzer and emitting per-recomposition details to logcat under the Recomposition tag. It supports release-with-debug-symbols builds and feeds a live recomposition heatmap in Android Studio.

Core Features & Use Cases

  • Instrumentation: annotate composables with @TraceRecomposition to collect per-recomposition diffs, including parameter state changes.
  • Runtime gating: gate instrumentation via ComposeStabilityAnalyzer.setEnabled(BuildConfig.DEBUG) or an explicit feature flag to avoid production overhead.
  • Debug visuals: integrate with Layout Inspector heatmaps and logcat to locate hot recompositions and verify fixes in release-like builds.

Quick Start

Annotate a suspect composable with @TraceRecomposition and enable the runtime gate (ComposeStabilityAnalyzer.setEnabled(BuildConfig.DEBUG)) in your Application to start emitting per-recomposition diffs to logcat during a debug or release-with-debug-symbols session.

Frequently Asked Questions about tracing-recompositions-at-runtime

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

FAQPage Schema
How do I trace Jetpack Compose recompositions at runtime?

To trace Jetpack Compose recompositions at runtime, instrument composables with the @TraceRecomposition annotation to emit per-recomposition diffs and parameter state changes directly to logcat.

Can I diagnose unstable parameters causing recompositions in release builds?

Yes, you can diagnose unstable parameters in release builds by using release-with-debug-symbols builds and enabling the compose-stability-analyzer runtime gate to emit recomposition details.

How does the compose-stability-analyzer heatmap work for debugging recompositions?

The compose-stability-analyzer heatmap integrates with Layout Inspector and logcat to visually locate hot recompositions, allowing you to verify parameter state changes and stability fixes during runtime sessions.

Do I need to gate recomposition tracing to avoid production overhead?

Yes, you should gate recomposition tracing using ComposeStabilityAnalyzer.setEnabled(BuildConfig.DEBUG) or an explicit feature flag to prevent instrumentation overhead in production environments.

What is the best way to log per-recomposition diffs in Android Studio?

The best way to log per-recomposition diffs is annotating suspect composables with @TraceRecomposition and viewing the emitted details under the Recomposition tag in logcat.

Why does my Jetpack Compose composable recompose unexpectedly?

Unexpected recompositions occur due to unstable parameters and state reads, which you can diagnose by applying the compose-stability-analyzer plugin and tracing per-recomposition diffs in logcat.