I've noticed that various common mutableStateOf<T> have specialized cases now, vis a vis mutableIntStateOf. Without knowing the exact details of what this optimizes, I was surprised that there isn't a mutableBoolStateOf? Is there something about boolean that makes it so the need to optimize/specialize it isn't necessary?
z
Zach Klippenstein (he/him) [MOD]
02/08/2024, 6:42 PM
It might be that booleans don’t typically change super frequently on every frame, which is typically why you need to worry about this kind of optimization. @Andrew Bailey ?
s
shikasd
02/08/2024, 6:54 PM
Booleans can be only true or false, both of those values are preallocated on JVM, so there's no reason to create a custom state wrapper