-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add ASExperimentalSkipClearData #trivial #1136
Conversation
Source/ASCollectionView.mm
Outdated
@@ -576,6 +576,11 @@ - (void)setAsyncDelegate:(id<ASCollectionDelegate>)asyncDelegate | |||
- (void)_asyncDelegateOrDataSourceDidChange | |||
{ | |||
ASDisplayNodeAssertMainThread(); | |||
|
|||
if (ASActivateExperimentalFeature(ASExperimentalSkipClearData)) { |
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.
Checking for nil
s is less expensive than checking for experiment, so let's do it first, e.g:
if (_asyncDataSource == nil && _asyncDelegate == nil && ASActivateExperimentalFeature(ASExperimentalSkipClearData)) {
[_dataController clearData];
}
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.
Good point
5edc05b
to
38449ec
Compare
🚫 CI failed with log |
Generated by 🚫 Danger |
|
* Add ASExperimentalSkipClearData * Move the experiment check within the if clause
This is a follow up on TextureGroup#1136. Our experiment results show that clearing data frequently is the cause of our TextureGroup#1 crash. @maicki and I believe that this is because if the collection view is being used, silently clearing its data without notifying the backing UICollectionView can put it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData is called. This made it extremely tricky to investigate and identify the root cause. Another interesting question would be whether or not we want to clear the data during deallocation at all, since the data will be cleared out soon anyway.
* Add ASExperimentalSkipClearData * Move the experiment check within the if clause
This is a follow up on #1136. Our experiment results show that clearing data frequently is the cause of our #1 crash. @maicki and I believe that this is because if the collection view is being used, silently clearing its data without notifying the backing UICollectionView can put it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData is called. This made it extremely tricky to investigate and identify the root cause. Another interesting question would be whether or not we want to clear the data during deallocation at all, since the data will be cleared out soon anyway.
…1154) This is a follow up on TextureGroup#1136. Our experiment results show that clearing data frequently is the cause of our #1 crash. @maicki and I believe that this is because if the collection view is being used, silently clearing its data without notifying the backing UICollectionView can put it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData is called. This made it extremely tricky to investigate and identify the root cause. Another interesting question would be whether or not we want to clear the data during deallocation at all, since the data will be cleared out soon anyway.
We are seeing crashes to an internal inconsistency deep within
UICollectionView
. We were able to track down the range of commits where we start seeing this crash. To verify the hunch of the root cause of this crash we will introduce a new experiment that will skip calling clear data ifdataSource
/delegate
is cleared withinASCollectionView
.