Add experiment to skip waiting until all updates of collection/table view are committed in -accessibilityElements

The wait was introduced in #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.
This commit is contained in:
Huy Nguyen
2019-01-11 13:06:51 -08:00
parent 17e56042d3
commit 7eb83fd780
6 changed files with 17 additions and 7 deletions
+4 -2
View File
@@ -19,10 +19,12 @@
"exp_unfair_lock",
"exp_infer_layer_defaults",
"exp_network_image_queue",
"exp_dealloc_queue_v2",
"exp_collection_teardown",
"exp_framesetter_cache",
"exp_skip_clear_data"
"exp_skip_clear_data",
"exp_did_enter_preload_skip_asm_layout",
"exp_disable_a11y_cache",
"exp_skip_a11y_wait"
]
}
}
+3 -1
View File
@@ -2455,7 +2455,9 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier";
- (NSArray *)accessibilityElements
{
[self waitUntilAllUpdatesAreCommitted];
if (!ASActivateExperimentalFeature(ASExperimentalSkipAccessibilityWait)) {
[self waitUntilAllUpdatesAreCommitted];
}
return [super accessibilityElements];
}
+1
View File
@@ -29,6 +29,7 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) {
ASExperimentalSkipClearData = 1 << 8, // exp_skip_clear_data
ASExperimentalDidEnterPreloadSkipASMLayout = 1 << 9, // exp_did_enter_preload_skip_asm_layout
ASExperimentalDisableAccessibilityCache = 1 << 10, // exp_disable_a11y_cache
ASExperimentalSkipAccessibilityWait = 1 << 11, // exp_skip_a11y_wait
ASExperimentalFeatureAll = 0xFFFFFFFF
};
+2 -1
View File
@@ -22,7 +22,8 @@ NSArray<NSString *> *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags
@"exp_framesetter_cache",
@"exp_skip_clear_data",
@"exp_did_enter_preload_skip_asm_layout",
@"exp_disable_a11y_cache"]));
@"exp_disable_a11y_cache",
@"exp_skip_a11y_wait"]));
if (flags == ASExperimentalFeatureAll) {
return allNames;
+3 -1
View File
@@ -2004,7 +2004,9 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
- (NSArray *)accessibilityElements
{
[self waitUntilAllUpdatesAreCommitted];
if (!ASActivateExperimentalFeature(ASExperimentalSkipAccessibilityWait)) {
[self waitUntilAllUpdatesAreCommitted];
}
return [super accessibilityElements];
}
+4 -2
View File
@@ -28,7 +28,8 @@ static ASExperimentalFeatures features[] = {
ASExperimentalFramesetterCache,
ASExperimentalSkipClearData,
ASExperimentalDidEnterPreloadSkipASMLayout,
ASExperimentalDisableAccessibilityCache
ASExperimentalDisableAccessibilityCache,
ASExperimentalSkipAccessibilityWait,
};
@interface ASConfigurationTests : ASTestCase <ASConfigurationDelegate>
@@ -51,7 +52,8 @@ static ASExperimentalFeatures features[] = {
@"exp_framesetter_cache",
@"exp_skip_clear_data",
@"exp_did_enter_preload_skip_asm_layout",
@"exp_disable_a11y_cache"
@"exp_disable_a11y_cache",
@"exp_skip_a11y_wait"
];
}