-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with performance in case of dequeueReusableCell #23
Comments
Hi, @karpov3 This is an interesting problem. TBH I've never encountered any performance issues with Rx. I wonder is it establishing transformations takes so much time (and it's really surprising, as it's just allocation of some operator classes) |
@sergdort Yes, I have pretty complex cell, because inside of it I have another CollectionView. Every time when cell is reused, in transform method I initialize viewmodels for nested CollectionView. It takes time. Temporary, to resolve the issue, I removed from transform Driver that initialize viewmodels for nested collectionView and declared it as a constant. |
Yeah, I would not use this solution for `UI{Table/Collection}ViewCell. And have them as a constant property on a VM |
Hi @sergdort , thank you for your interesting work. We got a lot of inspiring things from that.
I would like to share one of the problem that we are trying to resolve in process of adopt Input, Output and transform method between View and ViewModel.
In our project we use RxSwift + MVVM + Coordinator. ViewModel of Cell in our UICollectionView has to implement some work for UI of cell. So when UICollectionViewDataSource calls dequeueReusableCell every time Cell calls method transform and create new output from ViewModel. It requires a little bit of time for UI so it’s visible on scroll. In our first approach, Cell subscribed on event of already created VIewModel and it worked fine (but this solution was less functional). Now we call every time transform method and it blocks UI on scroll because ViewModel should be recreated every time.
Did you ever think about similar situation or do you have some ideas how it can be resolved?
Thank you
The text was updated successfully, but these errors were encountered: