<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nitin Praksh on Medium]]></title>
        <description><![CDATA[Stories by Nitin Praksh on Medium]]></description>
        <link>https://medium.com/@prakashnitin?source=rss-aa076e697e04------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0GTm_K1kBP29uHQ8YpDuPw.jpeg</url>
            <title>Stories by Nitin Praksh on Medium</title>
            <link>https://medium.com/@prakashnitin?source=rss-aa076e697e04------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 17:50:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prakashnitin/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why Your LazyColumn Drops Frames — Part 3: Production Polish]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://prakashnitin.medium.com/why-your-lazycolumn-drops-frames-part-3-production-polish-664fe0260cdc?source=rss-aa076e697e04------2"><img src="https://cdn-images-1.medium.com/max/2600/1*Xpxk8w3BW1bJnCGiU-K4Xw.jpeg" width="6000"></a></p><p class="medium-feed-snippet">A guide to the final layer of optimization</p><p class="medium-feed-link"><a href="https://prakashnitin.medium.com/why-your-lazycolumn-drops-frames-part-3-production-polish-664fe0260cdc?source=rss-aa076e697e04------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://prakashnitin.medium.com/why-your-lazycolumn-drops-frames-part-3-production-polish-664fe0260cdc?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/664fe0260cdc</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Thu, 21 May 2026 13:24:12 GMT</pubDate>
            <atom:updated>2026-05-21T13:24:12.222Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why Your LazyColumn Drops Frames — Part 2: Hidden Patterns]]></title>
            <link>https://proandroiddev.com/why-your-lazycolumn-drops-frames-part-2-hidden-patterns-78622d10ca40?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/78622d10ca40</guid>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 21:43:07 GMT</pubDate>
            <atom:updated>2026-01-25T11:18:09.663Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Your LazyColumn Drops Frames — Part 2: Hidden Patterns</h3><p><em>A engineer’s guide to the architectural traps that survive code review</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lFrDKCMzmhTmDS1pAZC56Q.jpeg" /><figcaption><a href="https://www.pexels.com/photo/three-black-and-pink-plaid-cellphone-cases-7742544/">Photo by Rann Vijay</a></figcaption></figure><p>In <a href="https://blog.devgenius.io/why-your-lazycolumn-drops-frames-part-1-quick-fixes-e6ccc53046bc"><strong>Part 1</strong></a>, we tackled the four foundation issues that cause 80% of LazyColumn performance problems: missing keys, unstable data classes, lambda allocations, and computation during composition.</p><p>You’ve implemented those fixes.</p><p>Your Layout Inspector shows fewer recompositions. Your keys are stable. Your state is immutable.</p><p>Yet when you profile on a mid-range device, you still see frame drops during rapid scrolling.</p><p>Here’s why: <strong>The patterns you’re using look architecturally sound. They pass code review. They follow Compose best practices. But they hide subtle performance costs that compound at scale.</strong></p><p>This is <strong>Part 2</strong>, where we explore the <strong>architectural and structural decisions</strong> that experienced engineers make — patterns that seem intelligent but create invisible performance penalties.</p><p>These aren’t bugs. They’re design choices with non-obvious trade-offs.</p><h3>The Architectural Reality</h3><p>Foundation fixes <strong>(</strong><a href="https://medium.com/dev-genius/why-your-lazycolumn-drops-frames-part-1-quick-fixes-e6ccc53046bc"><strong>Part 1</strong></a><strong>)</strong> handle <strong>what</strong> triggers recomposition.</p><p>Architectural patterns <strong>(Part 2)</strong> determine <strong>how much work</strong> each recomposition does.</p><p>The difference between a LazyColumn that “works fine in development” and one that “feels native on a Galaxy A53” is often these five patterns.</p><h3>5️⃣ The derivedStateOf Anti-Pattern Nobody Warns You About</h3><h4>❌ The Seemingly Smart Optimization</h4><pre>@Composable<br>fun MessageList(messages: List&lt;Message&gt;) {<br>    val searchQuery by searchViewModel.query.collectAsState()<br>    <br>    // &quot;I&#39;ll only recompose when filtered results change!&quot;<br>    val filteredMessages by remember(messages, searchQuery) {<br>        derivedStateOf {<br>            messages.filter { <br>                it.content.contains(searchQuery, ignoreCase = true) <br>            }<br>        }<br>    }<br>    <br>    LazyColumn {<br>        items(<br>            items = filteredMessages,<br>            key = { it.id }<br>        ) { message -&gt;<br>            MessageCard(message)<br>        }<br>    }<br>}</pre><p><strong>Why this looks correct:</strong></p><ul><li>Uses derivedStateOf for &quot;smart&quot; updates</li><li>Only recalculates when dependencies change</li><li>Appears to follow Compose best practices</li></ul><p><strong>The invisible problem:</strong></p><p>derivedStateOf recalculates <strong>during composition</strong>, on the main thread. If you have 10,000 items:</p><ul><li>Every scroll event that causes recomposition</li><li>Triggers the filter lambda evaluation</li><li>Even if searchQuery hasn&#39;t changed</li><li>Creates GC pressure from intermediate lists</li><li>Blocks the composition thread</li></ul><h4>🔍 The Real-World Impact</h4><p>In a production messaging app with 5,000 conversations:</p><ul><li>Scroll event triggers recomposition</li><li>derivedStateOf re-evaluates filter (even though query unchanged)</li><li><strong>~8–12ms per scroll frame</strong> just for filtering</li><li>Visible stutter on Pixel 4a</li></ul><h4>✅ The Correct Pattern: ViewModel-Level State</h4><pre>class MessageViewModel : ViewModel() {<br>    private val _searchQuery = MutableStateFlow(&quot;&quot;)<br>    private val _messages = MutableStateFlow&lt;List&lt;Message&gt;&gt;(emptyList())<br>    <br>    val filteredMessages: StateFlow&lt;List&lt;MessageUiState&gt;&gt; = combine(<br>        _messages,<br>        _searchQuery<br>    ) { messages, query -&gt;<br>        messages<br>            .asSequence()  // Avoid intermediate collections<br>            .filter { it.content.contains(query, ignoreCase = true) }<br>            .map { it.toUiState() }<br>            .toList()<br>    }<br>    .flowOn(Dispatchers.Default)  // Off main thread<br>    .stateIn(<br>        scope = viewModelScope,<br>        started = SharingStarted.WhileSubscribed(5000),<br>        initialValue = emptyList()<br>    )<br>}<br><br>@Composable<br>fun MessageList(viewModel: MessageViewModel) {<br>    val filteredMessages by viewModel.filteredMessages.collectAsState()<br>    <br>    LazyColumn {<br>        items(<br>            items = filteredMessages,<br>            key = { it.id }<br>        ) { message -&gt;<br>            MessageCard(message)<br>        }<br>    }<br>}</pre><p><strong>Why this works:</strong></p><ul><li>Filtering happens <strong>once</strong> when state actually changes</li><li>Runs on Dispatchers.Default (background thread)</li><li>No work during scroll/recomposition</li><li>No intermediate allocations during composition</li><li>Compose just observes the result</li></ul><h3>6️⃣ The Hidden Cost of @Composable Functions Inside Items</h3><h4>❌ The Innocent Helper Function Pattern</h4><pre>@Composable<br>fun MessageCard(message: MessageUiState) {<br>    Column {<br>        MessageHeader(message)  // Looks clean and modular<br>        MessageBody(message)<br>        MessageFooter(message)<br>    }<br>}<br><br>@Composable<br>private fun MessageHeader(message: MessageUiState) {<br>    Row {<br>        Avatar(message.senderAvatar)<br>        Column {<br>            Text(message.senderName)<br>            Text(message.timestamp)<br>        }<br>    }<br>}<br><br>@Composable<br>private fun MessageBody(message: MessageUiState) {<br>    Text(message.contentText)<br>}<br><br>@Composable<br>private fun MessageFooter(message: MessageUiState) {<br>    Row {<br>        ReactionBar(message.reactions)<br>        ActionButtons(message)<br>    }<br>}</pre><h4>Why This Looks Correct</h4><p>At first glance, this pattern feels like textbook Compose:</p><ul><li>Clear separation of concerns</li><li>Small, reusable composables</li><li>Idiomatic composition-based design</li><li>Easy to read and maintain</li></ul><p>Nothing here <em>looks</em> wrong — and that’s exactly why it’s dangerous.</p><h4>The Non-Obvious Problem</h4><p>Every @Composable function introduces a <strong>composition scope boundary</strong>. When those composables receive parameters that Compose cannot prove to be stable (for example, a MessageUiState containing a List or other unstable types), each boundary becomes a potential recomposition hotspot. Child composables may recompose independently of their parent—often more frequently and unpredictably.</p><p>In a list of just <strong>50 items</strong>, this adds up fast:</p><ul><li>Parent MessageCard recomposes → <strong>50 recompositions</strong></li><li>Each child (Header, Body, Footer) can recompose independently → <strong>150+ recompositions</strong></li><li><strong>~3× recomposition overhead</strong> purely from scope boundaries</li><li>Every boundary also carries its own composition cost</li></ul><p>You’re not paying for slow code — you’re paying for <em>structure</em>.</p><h4>🔍 How to Detect This</h4><p>Use <strong>Layout Inspector</strong> with recomposition counts enabled:</p><pre>MessageCard: 2 recompositions<br>├─ MessageHeader: 5 recompositions ⚠️<br>├─ MessageBody: 3 recompositions<br>└─ MessageFooter: 4 recompositions</pre><h4>✅ The Performance-Conscious Approach</h4><pre>@Immutable<br>data class MessageUiState(<br>    val id: String,<br>    val senderName: String,<br>    val senderAvatar: String,<br>    val contentText: String,<br>    val timestamp: String,<br>    val reactions: ImmutableList&lt;ReactionUiState&gt;,  // Not List&lt;&gt;!<br>    val canDelete: Boolean,<br>    val canEdit: Boolean<br>)<br><br>@Composable<br>fun MessageCard(<br>    state: MessageUiState,<br>    onReactionClick: (String) -&gt; Unit,<br>    onDeleteClick: (String) -&gt; Unit,<br>    modifier: Modifier = Modifier<br>) {<br>    // Inline layout for critical rendering path<br>    Column(modifier = modifier.padding(16.dp)) {<br>        // Header - inline instead of separate composable<br>        Row(<br>            modifier = Modifier.fillMaxWidth(),<br>            verticalAlignment = Alignment.CenterVertically<br>        ) {<br>            AsyncImage(<br>                model = state.senderAvatar,<br>                contentDescription = null,<br>                modifier = Modifier<br>                    .size(40.dp)<br>                    .clip(CircleShape)<br>            )<br>            Spacer(modifier = Modifier.width(12.dp))<br>            Column(modifier = Modifier.weight(1f)) {<br>                Text(<br>                    text = state.senderName,<br>                    style = MaterialTheme.typography.titleMedium<br>                )<br>                Text(<br>                    text = state.timestamp,<br>                    style = MaterialTheme.typography.bodySmall,<br>                    color = MaterialTheme.colorScheme.onSurfaceVariant<br>                )<br>            }<br>        }<br>        <br>        Spacer(modifier = Modifier.height(8.dp))<br>        <br>        // Body - inline<br>        Text(<br>            text = state.contentText,<br>            style = MaterialTheme.typography.bodyMedium<br>        )<br>        <br>        Spacer(modifier = Modifier.height(8.dp))<br>        <br>        // Footer - only extract if truly complex<br>        if (state.reactions.isNotEmpty()) {<br>            ReactionBar(<br>                reactions = state.reactions,<br>                onReactionClick = onReactionClick<br>            )<br>        }<br>    }<br>}<br><br>// Only extract composables when:<br>// 1. They&#39;re truly reusable across multiple screens<br>// 2. They have complex state management worth isolating<br>// 3. They&#39;re heavy enough that isolation provides clear benefit<br>@Composable<br>private fun ReactionBar(<br>    reactions: ImmutableList&lt;ReactionUiState&gt;,<br>    onReactionClick: (String) -&gt; Unit<br>) {<br>    Row(<br>        modifier = Modifier.fillMaxWidth(),<br>        horizontalArrangement = Arrangement.spacedBy(8.dp)<br>    ) {<br>        reactions.forEach { reaction -&gt;<br>            ReactionChip(<br>                reaction = reaction,<br>                onClick = { onReactionClick(reaction.id) }<br>            )<br>        }<br>    }<br>}</pre><p><strong>Key principles:</strong></p><ul><li>Inline simple layouts in the critical path</li><li>Only extract when complexity or reusability justify the overhead</li><li>Use @Immutable or @Stable for all parameter types</li><li>Minimize composition scope boundaries</li></ul><p><strong>Measured improvement:</strong></p><ul><li>Recompositions reduced by <strong>~40%</strong></li><li>Composition overhead per item: <strong>-3ms</strong> average</li></ul><h3>7️⃣ The Modifier Creation Tax (The Misdiagnosed Bottleneck)</h3><h4>❌ The Common Assumption</h4><pre>LazyColumn {<br>    items(messages, key = { it.id }) { message -&gt;<br>        MessageCard(<br>            message = message,<br>            modifier = Modifier<br>                .fillMaxWidth()<br>                .padding(horizontal = 16.dp, vertical = 8.dp)<br>                .clip(RoundedCornerShape(12.dp))<br>                .background(MaterialTheme.colorScheme.surface)<br>                .clickable { onMessageClick(message.id) }<br>        )<br>    }<br>}</pre><h4>Why This Looks Like a Problem</h4><ul><li>Modifiers are immutable and chained</li><li>Each modifier call returns a new object</li><li>LazyColumn items recompose during scroll</li><li>It <em>feels</em> like this must be allocating heavily</li></ul><p>This pattern often gets flagged during performance reviews as a “hidden allocation trap”.</p><h4>✅ The Architectural Reality</h4><p><strong>Modifier allocations exist — but they are almost never the reason LazyColumn drops frames.</strong></p><p>Important context:</p><ul><li>Modifier allocations are <strong>tiny</strong></li><li>They are <strong>short-lived</strong> and efficiently handled by ART</li><li>LazyColumn <strong>reuses item compositions aggressively</strong></li><li>Recomposition does <strong>not automatically trigger layout or draw</strong></li></ul><p>In production profiling, modifier allocation rarely shows up as a dominant cost.</p><blockquote><em>If your LazyColumn janks, modifier creation is usually not the root cause.</em></blockquote><h4>❌ The Real Mistake Engineers Make</h4><p>The problem isn’t <em>creating modifiers</em> — <br> it’s <strong>optimizing modifiers instead of fixing recomposition and layout work</strong>.</p><p>This leads to premature and sometimes harmful optimizations.</p><h4>🚫 The Most Common Anti-Patterns</h4><p>❌ Remembering static modifier chains</p><pre>val cardModifier = remember {<br>    Modifier<br>        .fillMaxWidth()<br>        .padding(16.dp)<br>}</pre><p>Why this is risky:</p><ul><li>Modifiers depend on <strong>density, layout direction, and theme</strong></li><li>Remembering them can produce stale or incorrect behavior</li><li>Compose already optimizes modifier usage internally</li></ul><blockquote><strong><em>Rule:</em></strong><em> Don’t </em><em>remember modifiers unless profiling proves it helps.</em></blockquote><h4>❌ Manual modifier caches</h4><pre>class ModifierCache { ... }</pre><p>This pattern:</p><ul><li>Adds architectural complexity</li><li>Introduces correctness risks</li><li>Solves a problem that rarely appears in real LazyColumn profiles</li></ul><p>If modifier reuse were broadly necessary, Compose would expose first-class APIs for it.</p><h4>⚠️ When Modifier Allocation Can Matter</h4><p>Modifier creation becomes relevant only when <strong>all</strong> of the following are true:</p><ul><li>Large lists with frequent recomposition</li><li>Heavy allocation elsewhere in the item</li><li>Layout or draw work triggered during scroll</li><li>Low-end or memory-constrained devices</li><li>Verified via <strong>Android Studio Profiler</strong></li></ul><p>Without measurement, modifier optimization is speculative.</p><h4>✅ The Correct LazyColumn Pattern</h4><p>Prefer <strong>clear modifier chains + stable state</strong>.</p><pre>@Composable<br>fun MessageCard(<br>    state: MessageUiState,<br>    modifier: Modifier = Modifier,<br>    onClick: () -&gt; Unit<br>) {<br>    Card(<br>        modifier = modifier<br>            .fillMaxWidth()<br>            .padding(16.dp)<br>            .clickable(onClick = onClick)<br>    ) {<br>        // Content<br>    }<br>}</pre><p>Why this works:</p><ul><li>Modifier creation is cheap</li><li>Compose can skip recomposition and layout</li><li>Performance scales predictably with list size</li></ul><h3>🔍 How to Validate This Properly</h3><p>Before touching modifiers, check:</p><ul><li><strong>Layout Inspector → recomposition counts</strong></li><li><strong>Profiler → layout &amp; measure time</strong></li><li><strong>Profiler → GC during scroll</strong></li></ul><h3>8️⃣ The contentType Parameter Everyone Ignores</h3><p>This is possibly <strong>the most underutilized performance optimization</strong> in LazyColumn.</p><h4>❌ Mixed Content Types Without Hints</h4><pre>sealed class FeedItem {<br>    data class TextPost(<br>        val id: String,<br>        val content: String,<br>        val author: String<br>    ) : FeedItem()<br>    <br>    data class ImagePost(<br>        val id: String,<br>        val imageUrl: String,<br>        val caption: String<br>    ) : FeedItem()<br>    <br>    data class VideoPost(<br>        val id: String,<br>        val videoUrl: String,<br>        val thumbnail: String<br>    ) : FeedItem()<br>    <br>    data class AdPost(<br>        val id: String,<br>        val adData: AdData<br>    ) : FeedItem()<br>}<br><br>@Composable<br>fun SocialFeed(feedItems: List&lt;FeedItem&gt;) {<br>    LazyColumn {<br>        items(<br>            items = feedItems,<br>            key = { it.id }<br>        ) { item -&gt;<br>            when (item) {<br>                is TextPost -&gt; TextPostCard(item)<br>                is ImagePost -&gt; ImagePostCard(item)<br>                is VideoPost -&gt; VideoPostCard(item)<br>                is AdPost -&gt; AdCard(item)<br>            }<br>        }<br>    }<br>}</pre><p><strong>Why this looks correct:</strong></p><ul><li>Proper sealed class hierarchy</li><li>Type-safe when expression</li><li>Stable keys provided</li></ul><p><strong>The invisible performance hit:</strong></p><p>Compose pools and reuses compositions for performance. Without contentType, it tries to reuse a VideoPostCard composition for a TextPostCard, causing:</p><ul><li>Complete composition tear-down and recreation</li><li>Expensive layout recalculation</li><li>State loss and recreation</li><li>Unnecessary work during scroll</li></ul><h4>🔍 The Problem in Detail</h4><p>When scrolling a heterogeneous feed:</p><ol><li>VideoPostCard scrolls off-screen (composition goes to pool)</li><li>TextPostCard scrolls on-screen</li><li>Compose tries to reuse the pooled VideoPostCard composition</li><li>Realizes types don’t match</li><li>Throws away the composition</li><li>Creates new TextPostCard from scratch</li></ol><p><strong>This happens on every scroll with mixed content types.</strong></p><h4>✅ The contentType Optimization</h4><pre>@Composable<br>fun SocialFeed(feedItems: List&lt;FeedItem&gt;) {<br>    LazyColumn {<br>        items(<br>            items = feedItems,<br>            key = { it.id },<br>            contentType = { item -&gt;<br>                // Provide content type hint for composition pooling<br>                when (item) {<br>                    is TextPost -&gt; ContentType.TEXT<br>                    is ImagePost -&gt; ContentType.IMAGE<br>                    is VideoPost -&gt; ContentType.VIDEO<br>                    is AdPost -&gt; ContentType.AD<br>                }<br>            }<br>        ) { item -&gt;<br>            when (item) {<br>                is TextPost -&gt; TextPostCard(item)<br>                is ImagePost -&gt; ImagePostCard(item)<br>                is VideoPost -&gt; VideoPostCard(item)<br>                is AdPost -&gt; AdCard(item)<br>            }<br>        }<br>    }<br>}<br><br>// Define content types as constants for reuse<br>private enum class ContentType {<br>    TEXT, IMAGE, VIDEO, AD<br>}</pre><p><strong>Even better with type-safe approach:</strong></p><pre>sealed class FeedItem {<br>    abstract val id: String<br>    abstract val contentType: String<br>    <br>    data class TextPost(...) : FeedItem() {<br>        override val contentType = &quot;text&quot;<br>    }<br>    <br>    data class ImagePost(...) : FeedItem() {<br>        override val contentType = &quot;image&quot;<br>    }<br>    <br>    data class VideoPost(...) : FeedItem() {<br>        override val contentType = &quot;video&quot;<br>    }<br>}<br><br>LazyColumn {<br>    items(<br>        items = feedItems,<br>        key = { it.id },<br>        contentType = { it.contentType }  // Simple and maintainable<br>    ) { item -&gt;<br>        when (item) {<br>            is TextPost -&gt; TextPostCard(item)<br>            is ImagePost -&gt; ImagePostCard(item)<br>            is VideoPost -&gt; VideoPostCard(item)<br>        }<br>    }<br>}</pre><p><strong>Why it’s so effective:</strong></p><p>Compose now maintains <strong>separate composition pools</strong> for each content type. When scrolling:</p><ul><li>TextPostCard scrolls off → goes to &quot;text&quot; pool</li><li>TextPostCard scrolls on → reused from &quot;text&quot; pool</li><li>No cross-type reuse attempts</li><li>Minimal composition overhead</li></ul><h3>9️⃣ Nested LazyRow Constraints Crisis</h3><h4>❌ The Common Horizontal Scroll Pattern</h4><pre>@Composable<br>fun CategoryList(categories: List&lt;Category&gt;) {<br>    LazyColumn {<br>        items(categories) { category -&gt;<br>            Column {<br>                Text(<br>                    text = category.title,<br>                    style = MaterialTheme.typography.titleLarge,<br>                    modifier = Modifier.padding(16.dp)<br>                )<br>                <br>                // Nested horizontal list<br>                LazyRow {<br>                    items(category.products) { product -&gt;<br>                        ProductCard(<br>                            product = product,<br>                            modifier = Modifier.width(160.dp)<br>                        )<br>                    }<br>                }<br>            }<br>        }<br>    }<br>}</pre><p><strong>Why this looks reasonable:</strong></p><ul><li>Common UI pattern (Netflix, Play Store, etc.)</li><li>Clean nested structure</li><li>Each list manages its own scrolling</li></ul><p><strong>The cascade of problems:</strong></p><ol><li><strong>Nested scrolling contexts</strong> create coordination overhead</li><li><strong>Unbounded height constraints</strong> cause multiple measure passes</li><li><strong>Each LazyRow independently manages composition</strong> (expensive)</li><li><strong>Scrolling outer list triggers measure</strong> in ALL nested LazyRows</li><li><strong>Layout thrashing</strong> as inner lists recalculate during outer scroll</li></ol><h3>🔍 The Performance Breakdown</h3><p>With 10 categories, each with 20 products:</p><ul><li>Scrolling outer list</li><li>Triggers measure on visible categories (3–4)</li><li>Each category’s LazyRow measures (even if not scrolling)</li><li>3–4 × 20 = <strong>60–80 items measured</strong> per scroll frame</li><li>Even though user is only scrolling the outer list</li></ul><p><strong>Frame time impact:</strong> +15–25ms per scroll frame</p><h4>✅ Solution 1: Fixed Height Constraints</h4><pre>@Composable<br>fun CategoryList(categories: List&lt;Category&gt;) {<br>    LazyColumn {<br>        items(categories, key = { it.id }) { category -&gt;<br>            Column {<br>                Text(<br>                    text = category.title,<br>                    style = MaterialTheme.typography.titleLarge,<br>                    modifier = Modifier.padding(16.dp)<br>                )<br>                <br>                LazyRow(<br>                    modifier = Modifier<br>                        .height(220.dp)  // ✅ Fixed height prevents remeasure<br>                        .fillMaxWidth(),<br>                    contentPadding = PaddingValues(horizontal = 16.dp),<br>                    horizontalArrangement = Arrangement.spacedBy(12.dp)<br>                ) {<br>                    items(<br>                        items = category.products,<br>                        key = { it.id },<br>                        contentType = { &quot;product&quot; }  // ✅ Content type for pooling<br>                    ) { product -&gt;<br>                        ProductCard(product)<br>                    }<br>                }<br>            }<br>        }<br>    }<br>}</pre><p><strong>Why this works:</strong></p><ul><li>Fixed height gives LazyRow stable constraints</li><li>Prevents remeasure during outer scroll</li><li>LazyRow only measures when it actually needs to</li></ul><h4>✅ Solution 2: Flatten When Possible (Best Performance)</h4><pre>// Transform nested structure into flat list<br>data class FeedItem(<br>    val type: FeedItemType,<br>    val categoryId: String? = null,<br>    val categoryTitle: String? = null,<br>    val productId: String? = null,<br>    val product: ProductUiState? = null<br>)<br><br>enum class FeedItemType {<br>    CATEGORY_HEADER,<br>    PRODUCT<br>}<br><br>class CategoryViewModel : ViewModel() {<br>    val feedItems: StateFlow&lt;List&lt;FeedItem&gt;&gt; = categoriesFlow<br>        .map { categories -&gt;<br>            categories.flatMap { category -&gt;<br>                buildList {<br>                    // Add category header<br>                    add(<br>                        FeedItem(<br>                            type = FeedItemType.CATEGORY_HEADER,<br>                            categoryId = category.id,<br>                            categoryTitle = category.title<br>                        )<br>                    )<br>                    // Add products<br>                    category.products.forEach { product -&gt;<br>                        add(<br>                            FeedItem(<br>                                type = FeedItemType.PRODUCT,<br>                                productId = product.id,<br>                                product = product.toUiState()<br>                            )<br>                        )<br>                    }<br>                }<br>            }<br>        }<br>        .stateIn(viewModelScope, SharingStarted.Lazily, emptyList())<br>}<br><br>@Composable<br>fun CategoryList(feedItems: List&lt;FeedItem&gt;) {<br>    LazyColumn {<br>        items(<br>            items = feedItems,<br>            key = { item -&gt;<br>                item.productId ?: item.categoryId ?: &quot;&quot;<br>            },<br>            contentType = { it.type }<br>        ) { item -&gt;<br>            when (item.type) {<br>                FeedItemType.CATEGORY_HEADER -&gt; {<br>                    Text(<br>                        text = item.categoryTitle ?: &quot;&quot;,<br>                        style = MaterialTheme.typography.titleLarge,<br>                        modifier = Modifier.padding(16.dp)<br>                    )<br>                }<br>                FeedItemType.PRODUCT -&gt; {<br>                    item.product?.let { product -&gt;<br>                        ProductCard(<br>                            product = product,<br>                            modifier = Modifier.padding(horizontal = 16.dp)<br>                        )<br>                    }<br>                }<br>            }<br>        }<br>    }<br>}</pre><p><strong>Trade-offs:</strong></p><p><strong>Flattened approach:</strong></p><ul><li>✅ Best scrolling performance</li><li>✅ Single scrolling context</li><li>✅ Simpler composition tree</li><li>❌ Loses horizontal scrolling per category</li><li>❌ Different UX pattern</li></ul><p><strong>Nested with constraints:</strong></p><ul><li>✅ Preserves horizontal scroll UX</li><li>✅ Good performance with proper constraints</li><li>❌ More complex composition</li><li>❌ Requires careful constraint management</li></ul><h4>✅ Solution 3: Hybrid Approach</h4><pre>// For categories with many items, use LazyRow with constraints<br>// For categories with few items, use regular Row<br><br>@Composable<br>fun CategoryList(categories: List&lt;Category&gt;) {<br>    LazyColumn {<br>        items(categories, key = { it.id }) { category -&gt;<br>            Column {<br>                Text(category.title, style = MaterialTheme.typography.titleLarge)<br>                <br>                when {<br>                    category.products.size &lt;= 5 -&gt; {<br>                        // Use regular Row for small lists<br>                        Row(<br>                            modifier = Modifier<br>                                .fillMaxWidth()<br>                                .horizontalScroll(rememberScrollState()),<br>                            horizontalArrangement = Arrangement.spacedBy(12.dp)<br>                        ) {<br>                            category.products.forEach { product -&gt;<br>                                ProductCard(product)<br>                            }<br>                        }<br>                    }<br>                    else -&gt; {<br>                        // Use LazyRow with constraints for large lists<br>                        LazyRow(<br>                            modifier = Modifier<br>                                .height(220.dp)<br>                                .fillMaxWidth()<br>                        ) {<br>                            items(<br>                                items = category.products,<br>                                key = { it.id }<br>                            ) { product -&gt;<br>                                ProductCard(product)<br>                            }<br>                        }<br>                    }<br>                }<br>            }<br>        }<br>    }<br>}</pre><p><strong>Measured improvement (nested LazyRow with constraints):</strong></p><ul><li>Frame time during outer scroll: <strong>-18ms</strong> average</li><li>Layout passes: <strong>-65%</strong></li><li>Smoother scroll perception</li></ul><h3>The Architectural Mental Model</h3><p><strong>Part 1</strong> taught you to <strong>minimize when</strong> composition happens. <strong>Part 2</strong> teaches you to <strong>minimize what</strong> happens during composition.</p><h3>The Three Architectural Principles:</h3><ol><li><strong>Defer Heavy Work</strong> → Move to ViewModel/background threads</li><li><strong>Minimize Scope Boundaries</strong> → Inline when possible, extract strategically</li><li><strong>Provide Type Hints</strong> → Help Compose optimize (contentType, stable types)</li></ol><h3>The Compounding Effect</h3><p>Each architectural issue adds 3–8ms per scroll frame. With all five issues:</p><ul><li><strong>Potential overhead: 15–40ms per frame</strong></li><li>That’s the difference between 60fps and 30fps</li></ul><h3>The Validation Checklist:</h3><ul><li>No derivedStateOf in composables (use ViewModel flows)</li><li>Minimal @Composable function boundaries in hot paths</li><li>Modifier chains cached in remember</li><li>contentType specified for heterogeneous lists</li><li>Nested lazy lists have fixed constraints OR are flattened</li></ul><blockquote>👉 Book time with me: <a href="https://topmate.io/nitin_droid/">https://topmate.io/nitin_droid/</a></blockquote><h3>What’s Next</h3><p>You’ve fixed the foundation issues. You’ve optimized the architecture.</p><p>But there’s one final layer: <strong>production-grade polish.</strong></p><p><em>What architectural patterns have you found that hurt LazyColumn performance? Share your experiences in the comments.</em></p><p><strong>← Back to Part 1: </strong><a href="https://blog.devgenius.io/why-your-lazycolumn-drops-frames-part-1-quick-fixes-e6ccc53046bc"><strong>Quick Fixes</strong></a></p><p><strong>Continue to Part 3: Production-Grade Performance →</strong> <em>(Coming soon)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78622d10ca40" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/why-your-lazycolumn-drops-frames-part-2-hidden-patterns-78622d10ca40">Why Your LazyColumn Drops Frames — Part 2: Hidden Patterns</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Gradle Plugin 9.0.0 — Complete Migration Guide]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/android-gradle-plugin-9-0-0-complete-migration-guide-873f901a1311?source=rss-aa076e697e04------2"><img src="https://cdn-images-1.medium.com/max/2600/1*mK87zP7SJ9NZT1C_yM8KNw.jpeg" width="7008"></a></p><p class="medium-feed-snippet">Released January 2026 | Major version with breaking changes</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/android-gradle-plugin-9-0-0-complete-migration-guide-873f901a1311?source=rss-aa076e697e04------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/android-gradle-plugin-9-0-0-complete-migration-guide-873f901a1311?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/873f901a1311</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 07:41:58 GMT</pubDate>
            <atom:updated>2026-01-25T11:19:48.310Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why Your LazyColumn Drops Frames — Part 1: Quick Fixes]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/why-your-lazycolumn-drops-frames-part-1-quick-fixes-e6ccc53046bc?source=rss-aa076e697e04------2"><img src="https://cdn-images-1.medium.com/max/2600/1*x7ls7GbybTY4rQl1dY7urw.jpeg" width="3648"></a></p><p class="medium-feed-snippet">A guide to the foundation performance traps everyone encounters</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/why-your-lazycolumn-drops-frames-part-1-quick-fixes-e6ccc53046bc?source=rss-aa076e697e04------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/why-your-lazycolumn-drops-frames-part-1-quick-fixes-e6ccc53046bc?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6ccc53046bc</guid>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 09:07:19 GMT</pubDate>
            <atom:updated>2026-01-25T11:20:14.847Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[❌ The Compose Shortcut That Quietly Ruins Your Architecture]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/the-compose-shortcut-that-quietly-ruins-your-architecture-2226b35dc289?source=rss-aa076e697e04------2"><img src="https://cdn-images-1.medium.com/max/2600/1*eHdgBnJntmvUBIKlVY4XqA.jpeg" width="6000"></a></p><p class="medium-feed-snippet">Here&#x2019;s What It Breaks in Real Jetpack Compose Apps</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/the-compose-shortcut-that-quietly-ruins-your-architecture-2226b35dc289?source=rss-aa076e697e04------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/the-compose-shortcut-that-quietly-ruins-your-architecture-2226b35dc289?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/2226b35dc289</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Wed, 14 Jan 2026 16:27:57 GMT</pubDate>
            <atom:updated>2026-01-25T11:20:35.609Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Navigation 3 in Compose: Type Safety and the Architecture of Scale]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/navigation-3-in-jetpack-compose-type-safety-and-the-architecture-of-scale-5e9c670bf05b?source=rss-aa076e697e04------2"><img src="https://cdn-images-1.medium.com/max/2600/1*rARhx9T2Gc4UKvGpJjpJ7g.jpeg" width="4216"></a></p><p class="medium-feed-snippet">I&#x2019;ve watched this library evolve from a promising experiment to a production-ready navigation solution. Navigation 3&#x2019;s type-safe API&#x2026;</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/navigation-3-in-jetpack-compose-type-safety-and-the-architecture-of-scale-5e9c670bf05b?source=rss-aa076e697e04------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/navigation-3-in-jetpack-compose-type-safety-and-the-architecture-of-scale-5e9c670bf05b?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e9c670bf05b</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 06:59:42 GMT</pubDate>
            <atom:updated>2026-01-25T11:21:22.406Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Preparing Your Android App for 16KB Page Size: A Complete Migration Guide]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/preparing-your-android-app-for-16kb-page-size-a-complete-migration-guide-dee353150fd1?source=rss-aa076e697e04------2"><img src="https://cdn-images-1.medium.com/max/1995/1*GT0lT7VWxunpRyXBdCT3bg.png" width="1995"></a></p><p class="medium-feed-snippet">Understanding and implementing Google Play&#x2019;s new requirements for Android 15+ applications</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/preparing-your-android-app-for-16kb-page-size-a-complete-migration-guide-dee353150fd1?source=rss-aa076e697e04------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/preparing-your-android-app-for-16kb-page-size-a-complete-migration-guide-dee353150fd1?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/dee353150fd1</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Tue, 19 Aug 2025 02:57:10 GMT</pubDate>
            <atom:updated>2026-01-25T11:21:48.174Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why lateinit is Problematic for Views in Fragments?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/why-lateinit-is-problematic-for-views-in-fragments-f14773390c67?source=rss-aa076e697e04------2"><img src="https://cdn-images-1.medium.com/max/1500/1*1HQfTdVFp8QlVAxdGVSv-Q.png" width="1500"></a></p><p class="medium-feed-snippet">Generated by Chat GPT</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/why-lateinit-is-problematic-for-views-in-fragments-f14773390c67?source=rss-aa076e697e04------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/why-lateinit-is-problematic-for-views-in-fragments-f14773390c67?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/f14773390c67</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 11:16:30 GMT</pubDate>
            <atom:updated>2025-12-26T03:27:11.050Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Demystifying the Android Build Process: A Deep Dive into APK Generation]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/demystifying-the-android-build-process-a-deep-dive-into-apk-generation-56fc3eb233a6?source=rss-aa076e697e04------2"><img src="https://cdn-images-1.medium.com/max/2600/1*nppG4S3Pjrjo32Wu0GL-uw.png" width="3840"></a></p><p class="medium-feed-snippet">As an Android developer, have you ever wondered about the intricate journey your code takes from source files to a fully functional APK&#x2026;</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/demystifying-the-android-build-process-a-deep-dive-into-apk-generation-56fc3eb233a6?source=rss-aa076e697e04------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/demystifying-the-android-build-process-a-deep-dive-into-apk-generation-56fc3eb233a6?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/56fc3eb233a6</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[apk]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Sat, 21 Sep 2024 06:51:18 GMT</pubDate>
            <atom:updated>2025-12-29T07:27:32.040Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Obfuscation Issues in Android SDK Development: Case Study]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.devgenius.io/obfuscation-issues-in-android-sdk-development-case-study-9c253d5c2115?source=rss-aa076e697e04------2"><img src="https://cdn-images-1.medium.com/max/2600/1*hdAGCtBtZbgIiiH9b5kNxw.jpeg" width="3000"></a></p><p class="medium-feed-snippet">Photo by Patrick Perkins on Unsplash</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/obfuscation-issues-in-android-sdk-development-case-study-9c253d5c2115?source=rss-aa076e697e04------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/obfuscation-issues-in-android-sdk-development-case-study-9c253d5c2115?source=rss-aa076e697e04------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c253d5c2115</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Nitin Praksh]]></dc:creator>
            <pubDate>Tue, 04 Jun 2024 02:06:47 GMT</pubDate>
            <atom:updated>2025-12-29T07:27:28.521Z</atom:updated>
        </item>
    </channel>
</rss>