What causes latency spikes in Objective‑C apps under concurrent NSOperation/GCD workloads?
0 reputation · 19 Jun 2023, 18:01 UTC
Goal
Determine which underlying mechanism—QoS class promotion, maxConcurrentOperationCount limits, or thread‑local storage contention—primarily produces latency spikes when many NSOperation or GCD tasks run concurrently on iOS/macOS.
Constraints include version‑specific behavior (e.g., iOS 15 vs iOS 16), undocumented interactions between NSOperation’s start method and KVO observers, and the lack of public metrics for internal thread‑pool saturation.
Which factor contributes most to the observed latency? Does lowering maxConcurrentOperationCount reduce spikes without excessively increasing total wait time? How does QoS promotion interact with TLS access patterns under bursty loads?