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

google_maps_flutter for iOS should allow pre-caching GMSServices #109057

Open
jonahwilliams opened this issue Aug 5, 2022 · 3 comments
Open

google_maps_flutter for iOS should allow pre-caching GMSServices #109057

jonahwilliams opened this issue Aug 5, 2022 · 3 comments
Labels
p: maps Google Maps plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team

Comments

@jonahwilliams
Copy link
Member

According to the documentation of https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_services , this object can be created ahead of map creation to reduce the initial map creation cost. From several profiling runs, this is expensive in debug/profile - though significantly less so in release mode.

Nevertheless, it would be nice to have especially if it could reduce the jank encountered while developing.

@jonahwilliams jonahwilliams added plugin p: maps Google Maps plugin P3 Issues that are less important to the Flutter project labels Aug 5, 2022
@jmagman
Copy link
Member

jmagman commented Aug 5, 2022

I spotted this in a trace:
trace

The +sharedServices doc says:

It also may be useful to take this object in advance of the first map creation, to reduce initial map creation performance cost.

@jmagman
Copy link
Member

jmagman commented Aug 5, 2022

I was looking at GM code, +sharedServices must be called on the main thread, but internally preps the service on a background thread. It should be retained to speed up initialization of the app.

Since it handles all the backgrounding, perhaps we should be call and retain it during registerWithRegistrar.

@jmagman jmagman self-assigned this Aug 5, 2022
@jmagman jmagman added P1 High-priority issues at the top of the work list and removed P3 Issues that are less important to the Flutter project labels Aug 5, 2022
@jmagman
Copy link
Member

jmagman commented Aug 8, 2022

flutter/plugins#6211 will cache +[GMSServices sharedServices] the first time a map is created after app launch so the initialization work can be shared over multiple maps (includes when the map is scrolled away and then comes back). This won't solve the initial jank though. @stuartmorgan recommends adding a pre-cache API so the developer can decide when to take that hit.

@stuartmorgan stuartmorgan added P2 Important issues not at the top of the work list and removed P1 High-priority issues at the top of the work list labels Jan 21, 2023
@jmagman jmagman removed their assignment Apr 21, 2023
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
@Hixie Hixie removed the plugin label Jul 6, 2023
@flutter-triage-bot flutter-triage-bot bot added team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: maps Google Maps plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team
Projects
None yet
Development

No branches or pull requests

4 participants