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

Annotation updates block main thread (iOS) #1798

Closed

Description

@parrots

Related to #1797 possibly, but when the map need to redraw as part of an update to the annotations, the main thread is blocked for an unusual amount of time resulting in paused UI rendering for other controls.

Example: http://f.cl.ly/items/1U2K0o0F0k462L1a092T/Blocker.m4v. You can see that during the ~0.5 seconds it takes to redraw the polylines, the rest of the UI in the app is hung waiting.

Activity

  1. added
    iOS
    performance
    on Jun 27, 2015
  2. added this to the ios-v2.1.0 milestone on Sep 1, 2015
  3. incanus commented on Sep 3, 2015

    @incanus
    Contributor

    Just confirming here @parrots — "update" to annotations means adding or removing in this context? So #1688 covers the flickering and this ticket covers the UI thread blocking.

  4. parrots commented on Sep 4, 2015

    @parrots
    Author

    That's correct.

  5. self-assigned this
    on Sep 4, 2015
  6. incanus commented on Sep 4, 2015

    @incanus
    Contributor

    @parrots I'm seeing pretty satisfactory performance of rapid adds & removes of annotations as of current pre-release. Check out this branch of a sample project I've been working on:

    https://github.com/incanus/UISyncedMap/tree/rapid-annotation-add-remove

    This adds a single static path, but then in response to a UI slider, removes all others and adds a new, small, red segment representing the next sub-segment in the path.

    Seems pretty snappy to me (keep in mind this is a GIF). We get a little annotation flashing still (#1688) but even MapKit does this IIRC. This is thousands of annotation removes and adds.

    Could you try ios-v-2.1.0-pre.2 per this method and see how it fares in your project?

  7. parrots commented on Sep 5, 2015

    @parrots
    Author

    It's running quite a bit better on-device. Running my app using this build of MapBox I'm getting 54-59 FPS on an iPhone 6 (swift whole-module optimization, etc -- all the good stuff). I notice a hickup here and there, but dramatically better. Apple Maps is 57-59 using the same setup.

    I'm seeing pretty similar characteristics on an iPhone 5 (just a tad lower, closer to 53 - 57 FPS).

    I'm noticing that in the simulator with this build I get more hiccups than I'd expect, or than I see on-device (this includes your sample project above, too). Feels closer, but a bit better than, what the old version of the SDK was like in terms of performance. Mapkit and Google maps don't exhibit the same slow-down in the sim. This is a vastly secondary problem, IMO, and shouldn't prevent this issue from being marked as resolved.

  8. incanus commented on Sep 5, 2015

    @incanus
    Contributor

    Awesome, glad to hear it. I have uncovered some root improvements that could be made, but I'm not sure if they'll go into this release yet or not.

  9. incanus commented on Sep 9, 2015

    @incanus
    Contributor

    This should ultimately get better in #1688, so I'm going to close here. Thanks for the testing and feedback @parrots.

  10. Gerz-inc commented on Jan 24, 2017

    @Gerz-inc

    I have block main thread problem on annotations adding (AnnotationView) in version 3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

iOSperformance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions