Skip to content

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

Description

@bubenheimer

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions