We have a camera based application that uses multple threads and can be computationally intensive. What we are seeing is that behaves distinctly differently with unmodified code on iPhone 7 devices than it does on an iPhone 6S with all devices running iOS 10.0.2. What we have observed from timing various parts of the code using the system trace additions to iOS 10, is that for example around the CADisplayLink callback are the following numbers.
Process / Name Count Duration Min Duration Avg Duration Std Dev Duration Max Duration
7 Plus DisplayLink 585 9.49 s 1.41 ms 16.22 ms 4.08 ms 42.14 ms
7 Plus QT DisplayLink 355 954.66 ms 1.78 ms 2.69 ms 666.53 µs 6.58 ms
6S DisplayLink 541 2.86 s 4.18 ms 5.29 ms 968.72 µs 13.37 ms
We are using 1080p60 images from the camera.
Note that the average duration is much higher on the 7 Plus than it is on the lower powered 6S, as well as the max duration values. The other thing to note and this seems significant is that when you attach QuickTime to the iPhone 7 Plus things improve dramatically. This and other numbers we recorded show that when we attach QuickTime (QT) all the times are approximately 5 times faster. There is some internet traffic about the little core on the iPhone 7 being 5 times slower than the big core.
We have tried to adjust the QOS settings on the threads, to make sure they all use QOS_CLASS_USER_INTERACTIVE when appropiate. We have also increased the thread priority to the maximum value for the pthread scheduling. This does help what we see, but it still does not compare to the performance we see when QT is attached to the phone. We don't need these changes on the 6S with a less powerful cpu. What is it about the 7 Plus that requires us to do this?
Other observations the cpu time taken by mediaserverd is about 17% on the iPhone 6S, on the iPhone 7/7 Plus it can be as high as 70%, even when using the Apple camera app. We thought this may be impacting our application, and its ability to get time on the cpus.
The questions we have are,
- Has anyone else observed this with their applications?
- Why is it that attaching QuickTime to the iPhone 7 Plus boosts the performance by up to five times. Is it because it magically forces everything to run on the big core out of the big little pair?
What can we do in our code to have the same effect as attaching QuickTime.
Why has the cpu usage gone up on the mediaserverd on the 7 devices?
Many thanks
Dave