Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

unnecessary performance overhead for non-view annotations on iOS #5787

Closed
incanus opened this issue Jul 25, 2016 · 2 comments
Closed

unnecessary performance overhead for non-view annotations on iOS #5787

incanus opened this issue Jul 25, 2016 · 2 comments
Assignees
Labels
annotations Annotations on iOS and macOS or markers on Android bug iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage
Milestone

Comments

@incanus
Copy link
Contributor

incanus commented Jul 25, 2016

Looking separately into the perf issues mentioned in #5786, it seems that -[MGLMapView updateAnnotationViews] is called as a result of -[MGLMapView notifyMapChange]. This appears to run through every annotation on every frame update, doing unnecessary logic for annotations which are sprite-backed. In my testing of an entirely sprite-backed map, I am getting about 16% of time profiling spent on rendering the whole map and the same amount just to run through -[MGLMapView convertCoordinate:toPointToView:] when this is completely unnecessary for thousands of annotations.

screen shot 2016-07-25 at 12 00 44 pm

/cc @1ec5 @boundsj

@incanus incanus added bug iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage annotations Annotations on iOS and macOS or markers on Android labels Jul 25, 2016
@1ec5
Copy link
Contributor

1ec5 commented Jul 25, 2016

-updateAnnotationViews iterates over all the annotations, not just view-backed annotations and not just the annotations within the viewport. #5165 would provide a more reliable way to query for annotations in the current viewport than what we have now. Moving over to that new API should eliminate all the coordinate conversions when none of the annotations are view-backed.

@incanus
Copy link
Contributor Author

incanus commented Jul 25, 2016

Ah nice, good that we're tracking this already. Will leave this open as a todo. 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android bug iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

No branches or pull requests

3 participants