Skip to content
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 experiments to skip waiting for updates of collection and table views #1311

Merged
merged 10 commits into from
Jan 24, 2019

Conversation

nguyenhuy
Copy link
Member

@nguyenhuy nguyenhuy commented Jan 11, 2019

  • exp_skip_a11y_wait: An experiment that skips a wait when accessibility elements of a collection/table view is collected. The wait was introduced in Fix A11Y for horizontal collection nodes in Texture #1217. We suspect this causes some perf regressions and need to confirm via an experiment.
  • exp_skip_default_cell_layout_mode: An experiment that skips a new default behavior of ASCellLayoutModeNone, introduced in Introduce ASCellLayoutMode #1273. The new behavior blocks main thread when 1) the collection/table view reloads data (including the initial load and any subsequent ones), 2) there is a small number of async cells to be laid out, or 3) the collection/table view hasn't had enough content to fill the visible viewport. While I agree that this new behavior may help with display latency when it's more important than FPS (i.e during app startup), I'm not sure if this is the right approach and, even if it is, we need to measure its perf implications within our app. My main concern is that blocking the main thread during app startup prevents the app from performing other equally important tasks that are intentionally scheduled during that time. The new behavior also affects apps that optimize the first page's size to fill the viewport, but doesn't necessarily fill it entirely due to various reasons. In such case, it's actually quite bad to block main thread for the second batch update, because users may (and are welcome to) interact with the content of the first page.

…view are committed in -accessibilityElements

The wait was introduced in TextureGroup#1217 which blocks the main thread until updates are proccessed. We suspect this causes perf regressions accross the app and need to confirm this via an experiment.
@nguyenhuy nguyenhuy requested a review from maicki January 11, 2019 20:24
return YES;
if (!ASActivateExperimentalFeature(ASExperimentalSkipDefaultCellLayoutMode)) {
// Reload data is expensive, don't block main while doing so.
if (changeSet.includesReloadData) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this check because countForAsyncLayout doesn't account for reload data.

@ernestmama
Copy link
Contributor

LGTM

@ghost
Copy link

ghost commented Jan 17, 2019

🚫 CI failed with log

@nguyenhuy nguyenhuy changed the title [A11Y] Add experiment to skip waiting until all updates of collection/table view are committed Add experiments to skip waiting for updates of collection and table views Jan 22, 2019
@ghost
Copy link

ghost commented Jan 22, 2019

🚫 CI failed with log

Copy link
Member

@Adlai-Holler Adlai-Holler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than introducing an experiment flag for ignoring the new default layout mode, we should probably revert the default to be what it was before that original diff (I had mistakenly thought this was the case.) @appleguy Is it expected that the default mode changed and if so, thoughts?

@nguyenhuy
Copy link
Member Author

@Adlai-Holler Thanks for the review. Reverting back would be ideal actually. I was assuming that you were aware of the new default behavior.

@Adlai-Holler
Copy link
Member

Let's do this – would you be willing to add a new mode named e.g. ASCellLayoutModeSyncForSmallContent and have the experiment enable that mode as the default? Then ASCellLayoutModeNone will stay on and mean the previous default behavior?

@appleguy
Copy link
Member

I'm hoping to look at this in more detail today, however, I may not have time and don't want to block this from moving forward.

Running the experiment sounds good for sure. I'm a little more worried about changing the default again unless we are carefully coordinated because it would be dangerous for one of our big clients to accidentally ship that change. :)

If Huy is confident testing this flag as an option, than we can go from there?

@nguyenhuy
Copy link
Member Author

@appleguy I think it's better for the new behavior to be opt-in, at least until all of us are confident that it's beneficial and everyone should use it.
@Adlai-Holler I updated the diff with a new ASCellLayoutModeSyncForSmallContent mode. Please make sure to enable it on your end. Thank you.

Copy link
Member

@Adlai-Holler Adlai-Holler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Huy

@nguyenhuy nguyenhuy merged commit f180138 into TextureGroup:master Jan 24, 2019
wiseoldduck added a commit to wiseoldduck/Texture that referenced this pull request Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants