I am developing an application which utilizes ARKit using Swift and ObjC together. There is an ARSession running (always with ARWorldTrackingConfiguration
) and I am trying to utilize its features separately. So far I have implemented image tracking, QR detection and plane tracking. These are not active at the same time.
There is no SceneView. There is only one Metal view (MTKView), with my own shader in order to display frames that I receive from server and my camera feed on top of each other and apply filters to server data when necessary.
Problem is that the phone gets heated up really quickly. After 5 minutes or even less it turns into a fireball. Now I know that the operations I perform each frame (server communications and anchor management) are contributing into the problem but I have to, because of required business logic. I also know that tracking is CPU/GPU intensive. But how can I make it better, any suggestions?
Note: Currently testing on an iPhone 12 Pro Max.
CodePudding user response:
This is a tough one cause the symptom is probably due to unoptimized code. Since you said you have "required business logic" you might not get the chance to fix it. At this point I would just run some memory profiling templates like Activity Monitor or CPU counters. See if there is waisted computations that could reduce your energy usage.
Other than that you could buy an iPhone cooler.https://arstechnica.com/gadgets/2021/12/razers-rgb-smartphone-cooler-attaches-to-iphones-with-magsafe/