Closed crroush closed 2 weeks ago
Can you try to cache the annotations and add them with create(options: List<S>)
? For example, adding 10 annotations every time.
@Chaoba I have done that, which helps a little. I was hoping there was some way to either bypass the geojson parser and get an pass the annotation directly to the native side.
@crroush are you still experiencing this behavior on our most recent release, v10.9.1?
Closing as stale. Noting that if you need to apply some annotation property to all annotations - since v11.7.X it is possible to do so by applying this property to the annotation manager directly. Doing so (instead of styling every annotation individually) will result in much better performance.
Environment
Observed behavior and steps to reproduce
We are running an instance of mapbox 10.4.0, using the circleAnnotationManager to display lat/lon points on the map. There is a kotlin sharedflow that delivers and ingests the data and makes it available to the viewmodel for displaying on the map. The data is coming in at a rate of 100 msec a point. Watching the profile in Android studio it shows that GEOJSON_PARSER is eating up nearly 50+% of the available resources. This makes the map unusable.
This image from the Android Studio profiler shows what appears to be taking what is passed through the circleAnnotationManager, converting it to geojson, then doing an http post internally (maybe between the java and native side?) and I assume it must be converting it back from geojson on the native side? This sequence happens every time a new point is added to the circleManager.
This is how I am creating my CircleAnnotationOptions:
Then I add the circle using the circleAnnotationManager:
Expected behavior
Notes / preliminary analysis
Additional links and references