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

refs 654f015: bring back sprite-backed annotation option for comparison #5786

Closed
wants to merge 3 commits into from

Conversation

incanus
Copy link
Contributor

@incanus incanus commented Jul 25, 2016

Background in 654f015#commitcomment-18366764.

We should have sprite-backed annotations as an option still for comparison to view-backed until such time that view-backed performance is equal or of negligible difference.

This more or less reverses 654f015, though it doesn't bring back -mapView:didDeselectAnnotation:, of which I'm not sure what the point was—something about changing to pins if we don't have a sprite to reuse? Open to feedback here.

Subjectively, since last being in this code, I am noticing a pretty marked performance decrease for annotation sprites, possibly related to z-ordering that I see happening during map rotation. Might be something else. I'm going to profile out of curiosity separately from this—this PR is just about the functionality. But these should be a lot faster.

/cc @1ec5 @boundsj

@incanus incanus added 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
@mention-bot
Copy link

@incanus, thanks for your PR! By analyzing the annotation information on this pull request, we identified @1ec5, @friedbunny and @boundsj to be potential reviewers

incanus referenced this pull request Jul 25, 2016
Removed unused annotation image code from iosapp, now that bulk-added point annotations are backed by annotation views.
@@ -301,6 +316,7 @@ - (void)parseFeaturesAddingCount:(NSUInteger)featuresCount
MGLPointAnnotation *annotation = [MGLPointAnnotation new];
annotation.coordinate = coordinate;
annotation.title = title;
annotation.subtitle = [NSString stringWithFormat:@"View: %i", useViews];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a magic string to detect a view-backed annotation, subclass MGLPointAnnotation and check whether it’s a kind of that subclass below. The class check is slightly more efficient than a string comparison and more self-documenting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, was thinking about that but trying to avoid overhead of a class. Probably a good idea, though.

@incanus
Copy link
Contributor Author

incanus commented Jul 26, 2016

Merged manually into master after rebase as of 4e61b2e.

Sorry, forgot the [ios] out front; will get that next time.

@incanus incanus closed this Jul 26, 2016
@incanus
Copy link
Contributor Author

incanus commented Jul 26, 2016

Forgot to force push this into the branch after rebase; remedied as of 4e61b2e.

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 iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants