mapbox / mapbox/mapbox-maps-ios

Performance Issue with drawInMTKView:

Open
#1,537 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

Environment

  • Xcode version: 13.4.1
  • iOS version: 15.6 & 16
  • Devices affected: All
  • Maps SDK Version: 10.6

Observed behavior and steps to reproduce

On the initial load (without caching), flying a camera with a fixed duration will cause frame drops. This is sometimes also apparent when panning. Below is the code I'm using:

let cameraOptions = CameraOptions(center: .init(latitude: event.lat, longitude: event.long), zoom: 10)
self.mapView.camera.fly(to: cameraOptions, duration: 0.9)

Expected behavior

Consistent 60fps performance on up-to date hardware

Notes / preliminary analysis

It seems some drawing code is spending a significant time on the main thread causing frame drops. The style URI we're using: mapbox://styles/touchgrove/cl70b4lij000f14pndegvdba9

Additional links and references

Screenshot 2022-08-20 at 15 27 48

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the frame drops with camera.fly(to:duration:) on an uncached map using the linked style URI, then inspect drawInMTKView and the reported main-thread drawing work with profiling tools. Done means identifying and addressing the performance issue so camera flights maintain consistent 60fps on affected hardware.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.