mapbox-maps-ios
mapbox-maps-ios copied to clipboard
Unusual CPU usage on idle
Environment
- Xcode version: 13.4.1
- iOS version: 15.4.1
- Devices affected: iPhone 11 Pro
- Maps SDK Version: 10.4.3
Observed behavior and steps to reproduce
As you can see, the updateHeadingOrientationIfNeeded() is being called every second or so, which causes spikes in the CPU usage and energy usage.
Is there a way to stop this from happening?
@kushsolitary are you only experiencing this behavior when the location / heading are being displayed?
@kushsolitary are you only experiencing this behavior when the location / heading are being displayed?
I am seeing this without accessing the location/displaying the heading of the user.
We are also seeing uncomfortably high CPU usage when we have the user puck enabled.
With this line added to our code: map.location.options.puckType = .puck2D(), we sit at 30-40% CPU, but if I leave that line out I'm sitting at 0-4% CPU.
Any way to address this? We're having to disable the puck for now because it's so high
The original issue was addressed by limiting the frequency of heading updates impacting the rendering engine. We also planning some following improvements to optimize it further. The puck location usage issue is tracked in https://github.com/mapbox/mapbox-maps-ios/issues/1939#issuecomment-1594398407