googlemaps / googlemaps/android-maps-compose

Potentially overly slow initial map composition caused by exhaustively setting *all* possible map configuration options

Open
#499 2 comments 0 reactions 0 assignees View on GitHub
priority: p3 type: bug
Dominant language
Kotlin
Stars
1.3k
Forks
181
Avg merge
2d 23h
Merged PRs (30d)
18

Description

android-maps-compose 4.3.0

I see an avoidable performance hit in the code for the initial `GoogleMap()` subcomposition run: the code essentially configures all possible Map configuration options in an exhaustive manner, rather than only the ones that the API consumer cares about.

This includes CameraPositionState, LocationSource, all 9 properties in MapProperties, GoogleMap padding, and all 10 properties in MapUISettings. At least 22 GoogleMap class function calls upon initial composition, many of which may never actually need to be explicitly set.

Another part of the problem is that the `MapView` is already being rendered while all these options are set, exhaustively reconfiguring the map while it is being displayed.

All this would not be much of a problem if all the GoogleMap class function calls were guaranteed to execute swiftly. I suspect that this is not the case for all of them, e.g. due to synchronization/locking/blocking and inter-process calls.

Just to be clear: this is a potential architectural and performance problem I see in the code, not something I have actually experienced or tested.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.