Fix: Vision Framework Playgrounds Extremely Slow in Xcode 27

Fix: Vision Framework Playgrounds Extremely Slow in Xcode 27

Written by

in

Quick answer: In Xcode 27, Playgrounds running Vision requests can become extremely slow if the active run destination is set to an older simulator like iPhone 17 Pro. Change the run destination to iPhone 18 Pro (or the latest available) to restore normal execution speed.

Why this happens

Xcode 27 Playgrounds inherit the active run destination from the containing project or workspace. When that destination is an older simulator runtime (for example, iPhone 17 Pro running iOS 17), the Vision framework falls back to a legacy code path that is not optimized for the current SDK. The same Vision request that completes in seconds on a modern device runtime can take 5–10 minutes—or time out entirely—on the older runtime. The issue is not in your Vision code; it is the simulator version the Playground is targeting.

How to fix it

1. Change the Playground run destination to the latest iPhone simulator

  1. Open the Playground (standalone or embedded).
  2. In the toolbar, click the run-destination menu (it usually shows the current device name, e.g., “iPhone 17 Pro”).
  3. Select iPhone 18 Pro (or the newest iPhone simulator listed).
  4. Re-run the Playground. Vision requests should now complete in the expected time.

Note: If you are using an embedded Playground inside a project, the run destination is tied to the project’s active scheme. Change the scheme’s run destination to iPhone 18 Pro, then re-run the Playground.

2. Verify the fix with a minimal Vision request

import Vision
import UIKit

let request = VNRecognizeTextRequest()
request.recognitionLevel = .accurate

let handler = VNImageRequestHandler(cgImage: yourCGImage, options: [:])
try handler.perform([request])

if let observations = request.results {
    print("Found \(observations.count) text observations")
}

Run this snippet after switching the destination. It should finish in under a minute on typical test images.

How to prevent it

  • Keep the active run destination set to the latest iPhone simulator when working with Vision, Core ML, or other on-device intelligence frameworks in Playgrounds.
  • When creating a new Playground in a project, confirm the scheme’s destination before the first run.
  • If you must test on older runtimes, run the Vision code in a real app target on that simulator instead of a Playground; app targets do not exhibit the same slowdown.

FAQ

Why does the simulator version affect Playground speed but not a regular app target?

Playgrounds in Xcode 27 use a lightweight execution environment that inherits the project’s run destination. Older simulator runtimes ship with an unoptimized Vision library that lacks the performance improvements present in the iOS 18 SDK. A full app target links against the SDK you build with, so it gets the optimized code path regardless of the deployment target.

Do I need to update my Mac or Xcode to get iPhone 18 Pro?

Xcode 27 includes the iPhone 18 Pro simulator runtime by default. No additional download is required; just select it from the run-destination menu.

Will this fix work for other Vision tasks like object detection or barcode scanning?

Yes. Any VNRequest subclass (e.g., VNRecognizeTextRequest, VNDetectRectanglesRequest, VNCoreMLRequest) benefits from the newer simulator runtime because the underlying Vision framework is the same.

Sources & credits

Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.