<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-recompositions-that-weren-t-there--rreq1zvzn" -->

---
title: The Recompositions That Weren’t There! | daily.dev
description: A deep dive into why Jetpack Compose's Layout Inspector can drastically understate the real cost of recompositions, using Android Studio's Memory Profiler and...
canonical: https://daily.dev/posts/the-recompositions-that-weren-t-there--rreq1zvzn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Recompositions That Weren’t There! | daily.dev
og:description: A deep dive into why Jetpack Compose's Layout Inspector can drastically understate the real cost of recompositions, using Android Studio's Memory Profiler and...
og:url: https://daily.dev/posts/the-recompositions-that-weren-t-there--rreq1zvzn
og:image: https://api.daily.dev/og/posts/rreQ1ZvZn.png
og:image:alt: The Recompositions That Weren’t There!
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Recompositions That Weren’t There!

**[ProAndroidDev](https://daily.dev/sources/pand)** · 11 min read · 0 upvotes · 0 comments

## Summary

A deep dive into why Jetpack Compose's Layout Inspector can drastically understate the real cost of recompositions, using Android Studio's Memory Profiler and allocation tracking to uncover invisible re-evaluations and hidden work. Five root causes were found on a production balance screen: unstable data classes missing @Immutable, objects like AnnotatedString and Color being recreated every frame instead of remembered, unstable lambdas cascading recompositions to children, missing keys in lazy lists causing wrong-item recomposition, and unnecessary wrapper composables adding extra recomposition scopes. Fixing all five dropped allocations from roughly 14,800 to the low thousands, illustrating that the Layout Inspector's recomposition counter can look calm while the Compose runtime is doing far more defensive work than it reveals.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://proandroiddev.com/the-recompositions-that-werent-there-d2cf429c47f2>

## Questions this post answers

### Why does the Layout Inspector show few recompositions but the Memory Profiler shows thousands of allocations in Jetpack Compose?

The Layout Inspector only increments its counter when an entire composable scope finishes recomposing, but before deciding to skip or execute a scope, Compose still runs internal checks that allocate memory: re-evaluating remember blocks, re-instantiating captured lambdas via ComposableLambdaImpl.invoke, and diffing parameters for stability. These allocations are real but invisible to the Inspector's scope-level counter, while the Memory Profiler's allocation table catches every object created.

_Anyone chasing phantom Compose slowdowns can compare notes on Memory Profiler workflows via daily.dev._

### Why does Compose recompose a composable that receives a plain Kotlin data class as a parameter even when the data hasn't changed?

Compose determines skippability by proving parameter stability at compile time, and a data class without an @Immutable annotation isn't guaranteed stable because Compose can't be sure it won't be mutated after being passed in. This is worse when a field is typed as a plain List, since kotlin.collections.List is an interface that could be backed by a MutableList, forcing Compose to treat it as unstable and recompose defensively every time.

_Developers stabilizing Compose UIs can track annotation and immutable-collection practices through daily.dev._

### How do I stop a lambda passed to a Compose child composable from causing unnecessary recompositions on every parent recomposition?

Wrap the lambda in remember and read any values it needs through rememberUpdatedState instead of capturing them directly, so the lambda instance stays the same reference across recompositions even as parent state changes. Capturing mutable values directly inside a lambda expression recreates a new lambda instance on every parent recomposition, which child composables see as a changed parameter and recompose in response, cascading further down the tree.

_Teams debugging cascading Compose recompositions can follow related lambda-stability fixes on daily.dev._

## Similar posts on daily.dev

- [The Compose Recomposition Mistakes I Keep Seeing in Production](https://daily.dev/posts/the-compose-recomposition-mistakes-i-keep-seeing-in-production-qbkrh7nka) · ProAndroidDev · 0 upvotes · 0 comments
- [Jetpack Compose Performance Optimization](https://daily.dev/posts/jetpack-compose-performance-optimization-qw7nfjbya) · Towards Dev · 7 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#android](https://daily.dev/tags/android), [#kotlin](https://daily.dev/tags/kotlin), [#jetpack-compose](https://daily.dev/tags/jetpack-compose)

[View this post on daily.dev](https://daily.dev/posts/the-recompositions-that-weren-t-there--rreq1zvzn)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Recompositions That Weren’t There!","url":"https://daily.dev/posts/the-recompositions-that-weren-t-there--rreq1zvzn","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-recompositions-that-weren-t-there--rreq1zvzn"},"datePublished":"2026-09-03T17:11:27.579Z","dateModified":"2026-09-13T18:58:44.549Z","description":"A deep dive into why Jetpack Compose's Layout Inspector can drastically understate the real cost of recompositions, using Android Studio's Memory Profiler and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/db3940958db670603b6d405374c83402?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/db3940958db670603b6d405374c83402?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"ProAndroidDev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ProAndroidDev","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/656c1eb1f1ef4f91936e86fc16545114","url":"https://daily.dev/sources/pand"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-recompositions-that-weren-t-there--rreq1zvzn","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,android,kotlin,jetpack-compose","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ProAndroidDev","item":"https://daily.dev/sources/pand"},{"@type":"ListItem","position":3,"name":"The Recompositions That Weren’t There!"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-recompositions-that-weren-t-there--rreq1zvzn#faq","mainEntity":[{"@type":"Question","name":"Why does the Layout Inspector show few recompositions but the Memory Profiler shows thousands of allocations in Jetpack Compose?","acceptedAnswer":{"@type":"Answer","text":"The Layout Inspector only increments its counter when an entire composable scope finishes recomposing, but before deciding to skip or execute a scope, Compose still runs internal checks that allocate memory: re-evaluating remember blocks, re-instantiating captured lambdas via ComposableLambdaImpl.invoke, and diffing parameters for stability. These allocations are real but invisible to the Inspector's scope-level counter, while the Memory Profiler's allocation table catches every object created. Anyone chasing phantom Compose slowdowns can compare notes on Memory Profiler workflows via daily.dev."}},{"@type":"Question","name":"Why does Compose recompose a composable that receives a plain Kotlin data class as a parameter even when the data hasn't changed?","acceptedAnswer":{"@type":"Answer","text":"Compose determines skippability by proving parameter stability at compile time, and a data class without an @Immutable annotation isn't guaranteed stable because Compose can't be sure it won't be mutated after being passed in. This is worse when a field is typed as a plain List, since kotlin.collections.List is an interface that could be backed by a MutableList, forcing Compose to treat it as unstable and recompose defensively every time. Developers stabilizing Compose UIs can track annotation and immutable-collection practices through daily.dev."}},{"@type":"Question","name":"How do I stop a lambda passed to a Compose child composable from causing unnecessary recompositions on every parent recomposition?","acceptedAnswer":{"@type":"Answer","text":"Wrap the lambda in remember and read any values it needs through rememberUpdatedState instead of capturing them directly, so the lambda instance stays the same reference across recompositions even as parent state changes. Capturing mutable values directly inside a lambda expression recreates a new lambda instance on every parent recomposition, which child composables see as a changed parameter and recompose in response, cascading further down the tree. Teams debugging cascading Compose recompositions can follow related lambda-stability fixes on daily.dev."}}]}
```

