mapbox / mapbox/mapbox-navigation-ios
Performance issues on older iPads
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
### Mapbox Navigation SDK version
2.5.1
### Steps to reproduce
On older iPads (iPad 6th generation or older) when displaying a static map with user location the CPU will ramp to 60+ percent on device and remain at that level without directly interacting with or physically moving the iPad. This seems to be attributed to consistently updating the heading causing a redraw of the map.
If we add a distance filter to the mapView location options the CPU returns to an expected level.
`navigationMapView.mapView.location.options.distanceFilter = 10`
Newer iPads do not show the same CPU peak as older iPads.
[OfflineMaps.zip](https://github.com/mapbox/mapbox-navigation-ios/files/9096826/OfflineMaps.zip)

### Expected behavior
Using a static map should not overload the iPad's CPU.
### Actual behavior
Using a static map will overload the iPad's CPU for older generation iPads causing poor performance and lack of responsiveness to the iPad itself. A large portion of the iPads using our app are 5th to 6th generation.
### Is this a one-time issue or a repeatable issue?
repeatable
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue on an older iPad using the static map, user location, and the attached OfflineMaps.zip. Inspect navigationMapView.mapView.location.options and the heading-driven redraw behavior, comparing CPU usage with and without the distance filter. Done means static maps no longer sustain high CPU usage or become unresponsive on older iPads without requiring the workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100