Skip to content

JetBrains/intellij-community / .claude/skills/compose-ui

compose-ui

Verified

Write or audit Compose Desktop UI state, effects, and boundaries.

FileKindSize
OWNERSHIPother20 B
SKILL.mdskill md637 B
architecture/GUIDE.mdmarkdown5.7 KB
architecture/evals/evals.jsonconfig6.5 KB
architecture/references/animation.mdmarkdown11.3 KB
architecture/references/component-api-lists-performance.mdmarkdown4.1 KB
architecture/references/desktop-seams-review-output.mdmarkdown1.5 KB
architecture/references/effects.mdmarkdown1.7 KB
architecture/references/state-boundaries.mdmarkdown5.4 KB
architecture/skill-source.jsonconfig2.0 KB
audit/GUIDE.mdmarkdown14.1 KB
audit/evals/evals.jsonconfig18.1 KB
audit/references/api-hygiene.mdmarkdown8.8 KB
audit/references/audit-search-patterns.mdmarkdown3.9 KB
audit/references/boundary-violations.mdmarkdown3.3 KB
audit/references/effects/derived-state-of-guide.mdmarkdown2.2 KB
audit/references/effects/effect-selection-guide.mdmarkdown2.7 KB
audit/references/effects/infinite-loop-patterns.mdmarkdown2.6 KB
audit/references/effects/overview.mdmarkdown7.7 KB
audit/references/lazy-layouts/animate-item.mdmarkdown2.0 KB
audit/references/lazy-layouts/cache-window-and-prefetch.mdmarkdown3.2 KB
audit/references/lazy-layouts/desktop-scroll-measurement.mdmarkdown2.0 KB
audit/references/lazy-layouts/keys-and-content-type.mdmarkdown2.2 KB
audit/references/lazy-layouts/nested-lazy-layouts.mdmarkdown1.6 KB
audit/references/lazy-layouts/overview.mdmarkdown7.5 KB
audit/references/measurement/benchmarking-methodology.mdmarkdown1.9 KB
audit/references/measurement/overview.mdmarkdown5.5 KB
audit/references/measurement/profiler-setup.mdmarkdown2.5 KB
audit/references/modifiers/custom-modifier-node.mdmarkdown3.4 KB
audit/references/modifiers/modifier-order.mdmarkdown2.1 KB
audit/references/modifiers/overview.mdmarkdown7.4 KB
audit/references/modifiers/phase-deferral.mdmarkdown2.6 KB
audit/references/reporting-guidance.mdmarkdown2.3 KB
audit/references/stability/ci-stability-gate.mdmarkdown2.0 KB
audit/references/stability/desktop-measurement.mdmarkdown2.2 KB
audit/references/stability/overview.mdmarkdown7.6 KB
audit/references/stability/reading-classes-txt.mdmarkdown2.1 KB
audit/references/stability/reading-composables-txt.mdmarkdown1.9 KB
audit/references/stability/stabilising-types.mdmarkdown3.1 KB
audit/references/stability/stability-config-syntax.mdmarkdown1.6 KB
audit/references/stability/stability-inference-algorithm.mdmarkdown3.4 KB
audit/references/stability/strong-skipping-escape-hatches.mdmarkdown2.6 KB
audit/references/subcomposition/desktop-subcomposition-measurement.mdmarkdown1.7 KB
audit/references/subcomposition/overview.mdmarkdown7.2 KB
audit/references/subcomposition/subcomposition-decision-tree.mdmarkdown1.8 KB
audit/references/subcomposition/swing-panel-subcomposition.mdmarkdown1.8 KB
audit/references/tracing-setup.mdmarkdown5.3 KB
audit/references/tracing-usage.mdmarkdown6.3 KB
audit/skill-source.jsonconfig2.5 KB

audit/references/measurement/profiler-setup.md

View on GitHub
# Profiler Setup for Desktop

## JFR (Java Flight Recorder)

Built into JDK 11+. No installation required.

### Command-line recording

```bash
# Pass JVM flags via JAVA_TOOL_OPTIONS — --args are application arguments, not JVM arguments
JAVA_TOOL_OPTIONS="-XX:StartFlightRecording=duration=60s,filename=compose.jfr,settings=profile" \
  ./gradlew run
```

### Analysing the recording

```bash
jfr print --events ExecutionSample compose.jfr | head -n 100
```

Or open in JDK Mission Control (JMC) for a GUI flame graph.

### What to look for

- `ExecutionSample` events with `androidx.compose.runtime.ComposerKt` — recomposition overhead.
- `ExecutionSample` events with `androidx.compose.ui.node.LayoutNode` — layout overhead.
- `AllocationSample` events — object allocation hotspots.

## YourKit

Download from https://www.yourkit.com/download/. Best for heap analysis and live CPU sampling.

### Attach to running process

1. Start the desktop app through the project's normal run configuration or Gradle task.
2. Open YourKit, attach to the Gradle daemon process (or the app process if forked).
3. Start CPU sampling or capture a heap dump.

### Recommended views

- In the **CPU → Sampling** view, inspect hot frames in `ComposerKt`, `SnapshotStateKt`, and `LayoutNode`.
- In the **Memory → Heap Dump** view, search for retained `RecomposeScopeImpl` and `LayoutNode` instances.
- **Memory → Live Objects** — watch for growth in `SnapshotStateObserver` or `DerivedSnapshotState`.

## async-profiler

`async-profiler` is a low-overhead sampling profiler that generates flame graphs without requiring a full IDE profiler.

```bash
# Download from https://github.com/jvm-profiling-tools/async-profiler
./profiler.sh -d 30 -f flame.html <pid>
```

Open `flame.html` in a browser. Look for wide Compose runtime bars.

## Compose Tracing Runtime

If `androidx.compose.runtime:runtime-tracing` is on the classpath, trace events appear in
profilers:

```kotlin
implementation("androidx.compose.runtime:runtime-tracing:1.0.0")
```

This project does **not** currently include this dependency.

## Quick comparison

| Tool | Install | Best for | Overhead |
|------|---------|----------|----------|
| JFR | None (JDK built-in) | Broad CPU sampling, allocation profiling | Low |
| YourKit | Download + license | Heap dumps, live object search, detailed CPU | Medium |
| async-profiler | Download | Flame graphs, low-overhead production profiling | Very low |
| SideEffect logging | None | Quick recomposition counting | Zero |
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall