https://kotlinlang.org logo
#compose
Title
# compose
i

ildar.i [Android]

04/15/2022, 11:06 AM
we experience a lot of lag when LazyColumn adds a new portion of composables. What can we do to mitigate it? it’s a calendar with a lot of distinct Text()’s each month
c

Chris Fillmore

04/15/2022, 1:18 PM
Are you testing performance in debug builds or release builds? The performance of release builds is known to be better than debug, for compose.
i

ildar.i [Android]

04/15/2022, 2:02 PM
It's debug mostly, we have just started. But the lag is so drastic, it obviously won't go away on release builds. The lag happens when a new portion of items is being added to LazyColumn
c

Chris Fillmore

04/15/2022, 2:04 PM
The difference between debug and release builds is noticeable. You can search this channel for many of the same questions; it comes up often. I'm not saying you don't have a performance problem, but you should make sure to always measure performance in release builds, not debug.
👍 1
c

Colton Idle

04/15/2022, 5:06 PM
Yeah. Try a release build ORRR at the very least add
debuggable = false
flag to your debug build config in build.gradle just to see how perf improves.
z

Zach Klippenstein (he/him) [MOD]

04/15/2022, 5:45 PM
Are your list items homogenous? If not, make sure to specify the item type so compose can more efficiently recycle list nodes
d

Diraj H S

04/16/2022, 3:20 PM
@Zach Klippenstein (he/him) [MOD] Could you provide more info on how we can specify the item type in
LazyColumn
?
3 Views