From 981fe528dc301a22ca1546d7df5b346aa6e74e31 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sat, 27 Jun 2026 12:26:45 -0400 Subject: [PATCH] chore(debug): add Compose composition tracing deps (debug-only) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds androidx.compose.runtime:runtime-tracing and tracing-perfetto so recompositions show up as named slices in Perfetto system traces — the tool used to attribute the cold-start feed first-paint cost to specific composables. debugImplementation only (not shipped); all Apache-2.0. Usage (runtime-enable broadcast) documented inline. Co-Authored-By: Claude Opus 4.8 (1M context) --- amethyst/build.gradle.kts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/amethyst/build.gradle.kts b/amethyst/build.gradle.kts index 4088c67fd3..ae681168a5 100644 --- a/amethyst/build.gradle.kts +++ b/amethyst/build.gradle.kts @@ -348,6 +348,16 @@ composeCompiler { dependencies { implementation(platform(libs.androidx.compose.bom)) + // Compose composition tracing — DEBUG ONLY, profiling aid (not shipped). Makes each + // recomposition show up as a NAMED slice in Perfetto system traces so we can see which + // composable recomposes (e.g. during the cold-start feed first-paint). All Apache-2.0. + // Usage: runtime-enable, then capture a Perfetto trace with the `track_event` data source: + // adb shell am broadcast -a androidx.tracing.perfetto.action.ENABLE_TRACING \ + // -n com.vitorpamplona.amethyst.debug/androidx.tracing.perfetto.TracingReceiver + debugImplementation("androidx.compose.runtime:runtime-tracing") + debugImplementation("androidx.tracing:tracing-perfetto:1.0.0") + debugImplementation("androidx.tracing:tracing-perfetto-binary:1.0.0") + implementation(project(":quartz")) implementation(project(":commons")) implementation(project(":nestsClient"))