Hi! When doing unidirectional flows in pre-compose Android I constantly notice that it is nice to separate "static" properties from "dynamic" ones. For example if we render a
List<User>
where
User(id, name, isSelected)
and if this list is 100-200 users, then to immutably switch selection of 1 user costs a full realloc of whole List + 1 user object.
In light of this I tend to split into something resembling
Pair<List<User(id, name)>, Set<String>>
, i.e. "static" user props and "dynamic" set of selected ids.
It doesn't seem to be Compose specific, but I wonder, is this a good thing to do in general, or will ART optimize this anyway? And also: is there some terminology invented for this rather than mine static/dynamic thing?