We're having an issue where Qubit placement fetching is too slow. To give more context, once our home screen appears, we fetch 6 placements and show various views to the user based on placement content received. However, the placements are taking too much time to process, frequently over 10 seconds. This causes a noticeable delay between the time our users see the home screen, and when the Qubit related content appears. It's not a networking issue, the API requests usually take less than 300 ms.
Using Time Profiler I can see that the app spends most of its CPU time on QubitSDK. I believe, the issue is due to QBDispatchQueueService, all of the DispatchQueues created have a quality-of-service set to background. This simply doesn't give us enough resources for a timely UI update. Since we're using Qubit content to update the UI, userInteractive would be more appropriate.
I've verified this via Time Profiler, if I switch the quality-of-service of placements DispatchQueue from background:
to userInteractive:
the time spent processing the placements reduces significantly and Qubit content loads under 2 seconds.
There should be a way of setting the QoS on a particular DispatchQueue in QBDispatchQueueService.
@AdnanHamzabegovic - Many thanks for taking the time to report this issue. We'll get the team to take a look at what we can do here to improve performance as you suggest, for the upcoming releases.
We're having an issue where Qubit placement fetching is too slow. To give more context, once our home screen appears, we fetch 6 placements and show various views to the user based on placement content received. However, the placements are taking too much time to process, frequently over 10 seconds. This causes a noticeable delay between the time our users see the home screen, and when the Qubit related content appears. It's not a networking issue, the API requests usually take less than 300 ms.
Using Time Profiler I can see that the app spends most of its CPU time on QubitSDK. I believe, the issue is due to
QBDispatchQueueService
, all of theDispatchQueue
s created have a quality-of-service set tobackground
. This simply doesn't give us enough resources for a timely UI update. Since we're using Qubit content to update the UI,userInteractive
would be more appropriate.I've verified this via Time Profiler, if I switch the quality-of-service of placements
DispatchQueue
frombackground
:to
userInteractive
:the time spent processing the placements reduces significantly and Qubit content loads under 2 seconds.
There should be a way of setting the
QoS
on a particularDispatchQueue
inQBDispatchQueueService
.