-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[ASCollectionView / ASTableView] Optimize reloadData and reloadSection: methods. #1171
[ASCollectionView / ASTableView] Optimize reloadData and reloadSection: methods. #1171
Conversation
@lkzhao this is great, very glad to see this! Are there any areas in particular that I should focus on for review? @nguyenhuy 's original disk to attempt something similar was reverted a couple times, but I can't remember if we ever really landed it after the second time… this this is a attempting to do something similar with a new approach, correct? Just want to make sure I understand where the prior one left off, it will not re-land again? |
@appleguy Yes, both are optimizing reload calls. This patch includes the other one that Huy made and fixed the crashes we had earlier. I actually took some code directly from his fork. We can land this instead. Few notes about what I did here:
|
Thank you Luke, this summary was extremely helpful for me. I will review in detail soon. Sent from my iPhone
|
} | ||
|
||
if (_performingBatchUpdates) { | ||
[_batchUpdateBlocks addObject:^{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to notify the _layoutFacilitator
here? cc @binl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we will need to do
[_layoutFacilitator collectionViewWillEditCellsAtIndexPaths:@[[NSIndexPath indexPathForItem:0 section:0]] batched:YES/NO];
I have 2 main concerns/feedbacks about this PR:
Other than that, I reckon this new implementation should be faster than the one on master because we update |
@nguyenhuy Thanks for the review & feedbacks!! There are some code that I copied/converted and I am not entirely sure what they do. Let me talk to you tomorrow about some of the details int your review. |
a604876
to
bc741c9
Compare
bc741c9
to
40791dd
Compare
[ASCollectionView / ASTableView] Optimize reloadData and reloadSection: methods.
Very excited to land this! Thank you @lkzhao |
Calls reloadData & reloadSection on UITableView/UICollectionView instead of deleting/inserting one by one.
Similar to #1093.
Please review this but do not merge yet. still seeing that bug where collectionView will cause inconsistent crash when inserting rows unless [collectionView numberOfSections] is called before inserting.
@nguyenhuy
@appleguy