Unexpected lag when integrating ARKit with SceneKit on iOS 17 - performance optimization
I'm following best practices but I'm attempting to set up I'm experiencing important lag when integrating ARKit with SceneKit in my iOS 17 app. The app runs smoothly when using just SceneKit, but as soon as I add ARKit to the mix, the frame rate drops to around 10-15 FPS, even on newer devices. I've tried optimizing the scene by reducing the number of polygons and textures, but the performance doesn't improve. Here's a snippet of how I set up my scene and AR session: ```swift import ARKit import SceneKit class ViewController: UIViewController, ARSCNViewDelegate { @IBOutlet var sceneView: ARSCNView! override func viewDidLoad() { super.viewDidLoad() sceneView.delegate = self sceneView.showsStatistics = true let configuration = ARWorldTrackingConfiguration() configuration.planeDetection = [.horizontal, .vertical] sceneView.session.run(configuration) loadScene() } func loadScene() { let scene = SCNScene(named: "art.scnassets/scene.scn")! sceneView.scene = scene } } ``` I've ensured that my scene assets are well optimized and I've tested on multiple devices, including the iPhone 14 Pro Max and iPad Pro 2021, with the same results. I also checked the `ARSCNView` settings, but adjusting properties like `isUserInteractionEnabled` and `allowsCameraControl` didn't yield any improvements. The console logs show frequent warnings like `AR: Frame was dropped due to low session quality` and `AR: Failed to update frame: ARCamera unavailable`. I'm not sure what else to look for. Any suggestions on how to improve the performance or debug these issues effectively? The stack includes Swift and several other technologies. Has anyone else encountered this? This is for a application running on Debian. Could this be a known issue?