README and documentationIGListKit version: 3.4.0We using IGListKit on our new home screen. Recently we found issue with fast scrolling: cells don't appear on time, so user experience empty white rows.
Here video from example project:
https://github.com/Showmax/IGListKitLag/blob/master/lag_example.mp4
Here video from our app:
https://github.com/Showmax/IGListKitLag/blob/master/real_life_example.MP4
I was able to find similar issue #680, but it was related to different problem.
yup , facing same issue with normal list as well (not nested)
if anyone found solution for this ???
@ManWithBear I would suggest check your sizeForItem first.
@zhubofei can you be more specific?
We have 2 hardcoded cell sizes: portrait and square. All items initially in portrait size, on item appearance we perform asset request, and based on loaded data switch to asset specific size (portrait or square). Data fetched in buffered batch, so on scroll should be loaded only initial and final items.
@ManWithBear I checked the code and it seems alright. Have you ever run the project on a device or only in a simulator? The simulator has performance issue from time to time especially on lower-end macs.
@zhubofei Yes, both projects (our and example) have issues on devices (tested on SE, 6, X)
@ManWithBear I have little time testing. But I do find that the white spacing only appears when you scroll past the first GREY cell and then quickly scroll back. So I suspect it's something to do with the colorProvider part instead of the ListKit. I suggest you look into that part once more. And if the problem still not solved I can get back to you by the end of the week when I have more free time.
Hm, I was searching information around issues and accidentally found #1160. Looks like it same issue.
We solve this issue internally:
distinctUntilChanged on our Rx data streams for less ui updates@zhubofei feel free to close issue if you don't need any additional information. Thanks.
@ManWithBear can you please explain your solution here , how you have integrated distinctUntilChanged
@iOSUser110 our view layer subscribed on items stream from viewModel layer.
While investigating this issue we found that adapter gets way more updates that need to. We decrease updates count by using distinctUntilChanged. I'm not sure that it's helped a lot, since lag still happened after this change.
Real dealbreaker was turning off animations on update:
adapter.performUpdates(animated: true, completion: nil)
to
adapter.performUpdates(animated: false, completion: nil)
@ManWithBear if you鈥檙e getting a ton of updates quickly, I鈥檇 try fiddling with the coalescanceTime. We found 16ms is ideal in Instagram, and will be making that the default soon.
Sent with GitHawk
Most helpful comment
We solve this issue internally:
distinctUntilChangedon our Rx data streams for less ui updates@zhubofei feel free to close issue if you don't need any additional information. Thanks.