Has anyone seen performance issues with using gene...
# ios
a
Has anyone seen performance issues with using generated KMM NSObject subclasses for view data in Swift UI? For example, if you have a complex list view with real time data updates, does the diffing/equality checking for reference types vs value types (struct) have any impact on UI performance or partial re-rendering? I know that SwiftUI can work with classes for view data, but with all the magic diffing and equality checking under the hood, I'm wondering if converting the KMM objects into pure swift value type structs would be more performant for live updates.
a
Comparing and hash checking will obviously be slower in Kotlin/Obj-C compared to Swift because they use a dynamic message sending mechanism that comes with costs. But the difference is not so dramatic if we're talking about a reasonable (~1000) amount of data objects. However this amount of objects will defenetely slow down UI updates. So here I would recommend to check the way you organize your UI - that's probably the main reason of problems. Try to update single cells without triggering the whole table reload and keep reasonable amount of data objects to display (I think there are very few users who'll scroll through all 1000 rows).