Skip to content

Conversation

@Guardiola31337
Copy link
Contributor

  • Prevents from showing the location layer on every location update

Aims to fix the performance 📉 shown in mapbox/mapbox-navigation-android#1252

I was able to reproduce in master 👀

llp_jumpy

The idea is to call locationLayer.show() method only once (when the first valid fix is received).

Apparently, calling show > setRenderMode > LocationLayer#styleForeground > generateBitmap multiple times - especially when the RenderMode is GPS in which generateBitmap is called 4 times - is quite heavy and has a noticeable impact on low-end devices. This was tested on a Nexus 5 running Android 6.0

cc @danesfeder

@Guardiola31337 Guardiola31337 added ready for review When your PR has been personally reviewed, its time for an external contributors to approve location-layer-plugin Issues that deal with the location layer module labels Sep 3, 2018
@Guardiola31337 Guardiola31337 self-assigned this Sep 3, 2018
Copy link
Contributor

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

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

Great catch! I think it'd be cleaner to expose and use LocationLayer#isHidden flag instead of introducing a new one that tries to accomplish the same thing, or checking that flag inside of the LocationLayer.

…e - now location layer show method is called only once (when the first valid fix is received)
@Guardiola31337 Guardiola31337 force-pushed the pg-llp-show-layer-first-valid-fix branch from 50c6947 to 9077d99 Compare September 4, 2018 10:01
@Guardiola31337
Copy link
Contributor Author

@LukasPaczos

I think it'd be cleaner to expose and use LocationLayer#isHidden flag instead of introducing a new one that tries to accomplish the same thing

Yeah, that's a great idea! Thanks for the quick review here. This is ready for a second round of 👀

Copy link
Contributor

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

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

🚢

@Guardiola31337 Guardiola31337 merged commit 8384b90 into master Sep 4, 2018
@Guardiola31337 Guardiola31337 deleted the pg-llp-show-layer-first-valid-fix branch September 4, 2018 10:55
@LukasPaczos LukasPaczos added this to the location-layer-0.8.1 milestone Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

location-layer-plugin Issues that deal with the location layer module ready for review When your PR has been personally reviewed, its time for an external contributors to approve

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants