App on iPhone 7 Plus runs faster when system is busy

I'm experiencing a weird issue: on the 7 plus my app performs certain operations much faster when the system itself is under some load (for example, installing apps). The operations are mostly CPU-bound.

Is it possible that iOS keeps running on low power A10 cores even when there's a third-party app in foreground?

Replies

The operations are mostly CPU-bound.

How are you running those operations? With a thread? Via an operation queue? Via GCD?

Have you set the quality of service for those operations? The correct way to do that depends on your answer to the above, but the QoS values are unified across all of those APIs. See for a summary of those values, or any one of a bunch of recent WWDC sessions [1].

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

[1] The concept was first introduced at WWDC 2014 and has featured heavily in WWDC performance talks since then, so many that it’s hard for me to provide all the links. It’s probably best to start at the beginning, with WWDC 2014 Session 710 710 Writing Energy Efficient Code, Part 1.

They are scheduled on the main queue using DispatchQueue.main.async with no additional QoS settings.

I was assuming that the main queue schedules all it's tasks with highest appropriate QoS. If that's not the case, should I use UserInteractive with main queue to get lower latency?

They are scheduled on the main queue using DispatchQueue.main.async …

Hmmm, I was under the impression that these were long-running operations, and hence running off the main thread. How long, roughly, do these operations take?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Tens of milliseconds. The code itself is not particularly heavy; it does some basic text sizing via Core Text and allocates some memory along the way.

First things first, I recommend that you use the System Trace instrument to confirm that your code was actually scheduled on the CPU for that time.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"