Potentially overly slow initial map composition caused by exhaustively setting *all* possible map configuration options #499
Labels
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
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.
The text was updated successfully, but these errors were encountered: