mcpiroman
07/06/2022, 5:53 PMZach Klippenstein (he/him) [MOD]
07/06/2022, 6:02 PMmcpiroman
07/06/2022, 6:26 PMderivedStates.removeScope(value)
, there are still some performance issues with `recordReadOf`:
⢠identityHashCode
, used in `IdentityScopeMap`seems to be surprisingly expensive (at least on my Eclipse Adoptium 18.0.1). I've read that JDK lazely initializes it and then has to decode it from the object header, but still. Or it is just due to the binary search in IdentityScopeMap.find
.
⢠There are a cupule of iterations over non-linked hash sets. That shouldn't matter that much tho, unless the set ever shrinks?
⢠When called from DerivedSnapshotState.getValue()
, the non-trivial `getCurrentValue()`function is called twice.shikasd
07/06/2022, 7:19 PMshikasd
07/06/2022, 7:25 PMremoveScope
to make sure we don't leak derived state for now
Maybe it is worth investing into a better strategy for handling it
Overall, Compose heavily relies on identity hashcode, assuming it is calculated in a constant time, so it taking long to calculate will slow down everything quite severelyshikasd
07/06/2022, 7:32 PM-XX:hashCode
Maybe tweaking that will result in somehow better performance :)mcpiroman
07/06/2022, 7:53 PMshikasd
07/06/2022, 7:56 PMmcpiroman
07/06/2022, 8:06 PMclass TreeNode {
val parent: TreeNode
var isExpanded by mutableStateOf(true)
val isVisible by derivedStateOf { parent.isExpanded && parent.isVisible && !isFilteredOutBySearch() }
}
shikasd
07/06/2022, 8:11 PMNorbi
07/07/2022, 8:21 AM-XXhashCode
.
E.g. https://shipilev.net/jvm/anatomy-quarks/26-identity-hash-code/shikasd
07/07/2022, 11:31 AM