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

trevjones

05/16/2022, 6:02 PM
So I have a calendar built via LazyColumn and have been trying to optimize it. Made some good gains by using the metrics compiler outputs as guidance. I am down to what appears to be modifier aggregation. Is there a built in way to have the column throttle how many items it attempts to do per thread frame?
z

Zach Klippenstein (he/him) [MOD]

05/16/2022, 6:19 PM
One thing you could try doing is `remember`ing big modifier chains, but i don’t know if that will help with materialization
just be mindful of dependencies – if you’re passing values into modifiers, if they’re not backed by states they should probably also be keys on the remember
t

trevjones

05/16/2022, 6:29 PM
Yes that will for sure be the case here. its just a bucket of booleans for what the modifier config will be. I'll prob just do a quick data class to make things explicit and the remember block more simple
j

Jon Boekenoogen

05/18/2022, 3:12 AM
If each calendar item is clickable, note there is active work to make clickables less expensive in upstream compose. That would help a bit here.
t

trevjones

05/18/2022, 2:16 PM
yeah they are almost all clickable. hard to know which modifiers are the culprit from the signatures in the flame charts though so I didn't assume it was one or the other. I've got it sped up to the point that only first load has a bit of jank. good enough for now.