From b194eb21e3d2b95cdc0625941283d97fcdcb9e2d Mon Sep 17 00:00:00 2001 From: Hanton Yang Date: Wed, 4 Sep 2019 23:02:41 -0700 Subject: [PATCH] Update queue priority in `Background Diffing` (#1363) Summary: ## Changes in this pull request Update to use `QoS` and take higher priority for responsiveness and energy efficiency. Following the guideline in the doc [Energy Efficiency Guide for iOS Apps](https://developer.apple.com/library/archive/documentation/Performance/Conceptual/EnergyGuide-iOS/PrioritizeWorkWithQoS.html). It's better to use `User-initiated` QoS in `Background Diffing` because it focuses on "Work that the user has initiated and requires immediate results". ### Checklist - [x] All tests pass. Demo project builds and runs. - [x] I added tests, an experiment, or detailed why my change isn't tested. - [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes. - [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md) Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1363 Differential Revision: D17200745 Pulled By: lorixx fbshipit-source-id: 4b9b2159f06edeed92e79bac771fe7b89f6d5708 --- Source/IGListAdapterUpdater.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/IGListAdapterUpdater.m b/Source/IGListAdapterUpdater.m index 130f9a81..464353f8 100644 --- a/Source/IGListAdapterUpdater.m +++ b/Source/IGListAdapterUpdater.m @@ -264,7 +264,7 @@ willPerformBatchUpdatesWithCollectionView:collectionView }; if (IGListExperimentEnabled(experiments, IGListExperimentBackgroundDiffing)) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{ IGListIndexSetResult *result = performDiff(); dispatch_async(dispatch_get_main_queue(), ^{ performUpdate(result);