Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOTFIX Add option to not use annotations - android performance #820

Merged
merged 3 commits into from
Dec 20, 2021

Conversation

felix-ht
Copy link
Collaborator

@felix-ht felix-ht commented Dec 16, 2021

Android performance has been much worse than ios - even on good hardware. #632 #733 #525

The root cause for this are the annotation managers. It is listening to all map gestures - checking for drag events - causing a massive slow down even if no annotations are added. Why this causes such a massive slowdown is unknown.

This PR gives the option to pass an empty annotation order annotationOrder: const []. If this is done the performance on android should be perfect. However if one does so, using the annotations is no longer possible.

But with the support of geojson layers, on can still have custom dynamic maps, as long as drag is not needed.

I will fully fix this in the future by implementing the annotation managers in dart #779

I also disabled textureMode - this should give a big boost in performance in android in general as it moves the processing out of the ui thread.

@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN December 16, 2021 12:34 Inactive
@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN December 16, 2021 12:34 Inactive
@felix-ht felix-ht added android bug Something isn't working labels Dec 16, 2021
example/lib/map_ui.dart Outdated Show resolved Hide resolved
@m0nac0
Copy link
Collaborator

m0nac0 commented Dec 16, 2021

@felix-ht I can't test this right now, but I wondered why we have texture mode enabled. Have you checked whether this issue still exists: #1 ?

@felix-ht
Copy link
Collaborator Author

@felix-ht I can't test this right now, but I wondered why we have texture mode enabled. Have you checked whether this issue still exists: #1 ?

will check

@felix-ht
Copy link
Collaborator Author

@m0nac0 rotating works fine for my device - even with texture mode turned off

@felix-ht
Copy link
Collaborator Author

felix-ht commented Dec 16, 2021

@m0nac0 one thing i noticed is that gestures don't work as expected after a screen rotation - however this is the case regardless of the textureMode

@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN December 16, 2021 13:39 Inactive
@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN December 16, 2021 13:39 Inactive
Copy link
Collaborator

@tobrun tobrun left a comment

Choose a reason for hiding this comment

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

I'm fine with patching this since it's a potential intermediate fix

@m0nac0
Copy link
Collaborator

m0nac0 commented Dec 19, 2021

@m0nac0 one thing i noticed is that gestures don't work as expected after a screen rotation - however this is the case regardless of the textureMode

Is that #195 or a different issue?

@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN December 20, 2021 17:07 Inactive
@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN December 20, 2021 17:07 Inactive
@felix-ht felix-ht merged commit 0feb12b into master Dec 20, 2021
@felix-ht felix-ht deleted the hotfix-android-performance branch December 20, 2021 17:28
@felix-ht
Copy link
Collaborator Author

@tobrun a new release would be great as there have been lots of bug fixed pushed to master since the last release.

However i would like to wait until after https://github.com/mapbox/mapbox-gl-js releases 2.6.2 as this fixes some major web issues

m0nac0 added a commit to maplibre/flutter-maplibre-gl that referenced this pull request May 20, 2022
…android performance)

https: //github.com/flutter-mapbox-gl/maps/pull/820
Co-Authored-By: Felix Horvat <[email protected]>
m0nac0 added a commit to maplibre/flutter-maplibre-gl that referenced this pull request May 20, 2022
…android performance) (#93)

Cherry-pick upstream#820 (HOTFIX Add option to not use annotations - android performance)

flutter-mapbox-gl/maps#820
Co-Authored-By: Felix Horvat <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants