ursus
10/30/2026, 3:08 AMfull value classes, they have no identity.. doesnt that break strong skipping?Marat Akhin
10/30/2026, 10:23 AM=== operation. How do you see this breaking strong skipping?ursus
10/30/2026, 11:07 AMMarat Akhin
10/30/2026, 11:29 AM=== is changed to be structural for value types, both we and Compose will update so that the performance in general doesn't suffer. And that is relevant not only to strong skipping, but in general to the expectations about === operation.
Second, before that happens, with unstable identity for value types you would sometimes get different boxes for effectively the same data, which means strong skipping would not skip when it actually could. But for that to happen, the value type should also be unstable (as stable types are still compared via ==), and many of the value types will be stable.
So it does not really break strong skipping, but it makes it miss some optimization opportunities.
Side-note: IIRC, if a module is compiled with Compose, the stability information for its types is preserved and used in dependent modules. So if smth is from a different module, it is not automatically unstable.ursus
10/31/2026, 2:04 AMursus
10/31/2026, 2:21 AMursus
10/31/2026, 2:33 AMshikasd
10/31/2026, 4:11 PMursus
10/31/2026, 4:24 PMdata class (to be value class) holding such list by say MutableStateFlow which does that implicitly on updateursus
10/31/2026, 4:30 PMshikasd
10/31/2026, 4:44 PMursus
10/31/2026, 5:23 PMshikasd
10/31/2026, 6:37 PMursus
10/31/2026, 7:01 PMshikasd
10/31/2026, 7:03 PMshikasd
10/31/2026, 7:03 PMursus
10/31/2026, 7:04 PMshikasd
10/31/2026, 7:06 PMursus
10/31/2026, 7:08 PMshikasd
10/31/2026, 7:09 PMursus
10/31/2026, 7:10 PMursus
10/31/2026, 7:14 PMshikasd
10/31/2026, 7:15 PMursus
10/31/2026, 7:16 PM=== check, and that wont compileursus
10/31/2026, 7:16 PMshikasd
10/31/2026, 7:34 PMfun changedInstance(val: Any): Boolean =
rememberedValue() === val
so from the runtime perspective it is the same as any other anyursus
10/31/2026, 7:38 PMshikasd
10/31/2026, 7:40 PMursus
10/31/2026, 7:41 PMursus
10/31/2026, 7:41 PMfun changedInstance(val: Any): Boolean =
> rememberedValue() === val
>
>
> so from the runtime perspective it is the same as any other any
doesn’t this then force the identity existence and therefore prohibiting scalarization etc? sort of like primitives boxing?shikasd
10/31/2026, 7:47 PMursus
10/31/2026, 7:48 PMursus
10/31/2026, 7:50 PMshikasd
10/31/2026, 7:51 PMursus
10/31/2026, 7:51 PMshikasd
10/31/2026, 7:53 PMursus
10/31/2026, 7:57 PMdata class State(val foo: Foo, val bar: Bar)
mutableStateFlow.update { it.foo = foo2 }
will run deep eq check on Bar as well, which it currently doesnt (identity shortcut)