If I render `Screen` and I can guarantee that its ...
# compose
z
If I render
Screen
and I can guarantee that its immutable, would it recompose fewer times/perform better if I wrapped it in a
ScreenWrapper
marked with
@Immutable
? I cant mark the actual screen, but I can use a value/inline class for the wrapper.
c
We did the exact same thing with `List`s, and it reduced the number of recompositions.
z
@Csaba Kozák Thats awesome, Im seeing a bit too many recompositions when a series of screens change in coordination. Ill give the immutable wrapper a shot!
z
This question is always a tradeoff between the time it takes to compare models vs time for recomposing. It's not just a matter of number of recompositions, eg if comparing `Screen`s is super expensive. Only way to know for sure is to try both and compare.
👍 2
👍🏼 1
👍🏽 1
z
Thanks @Zach Klippenstein (he/him) [MOD], I didnt think about that aspect of it when asking the question!