镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Unnecessary map initialization performance penalty caused by delaying composing GoogleMap() subcomposition until after GoogleMap object is available #501

Open

Description

@bubenheimer

android-maps-compose 4.3.0

From code inspection I've noticed that there is an undue performance penalty caused by delaying the GoogleMap() subcomposition until after the GoogleMap object has been made available via suspending MapView.awaitMap().

While the GoogleMap object is required during the "apply changes" phase of the subcomposition, it should not be required to perform the initial composition of the subcomposition, prior to "apply changes".

Initial composition phase of subcomposition and MapView.awaitMap() should and can be performed in parallel.

Activity

  1. added
    triage meI really want to be triaged.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jan 5, 2024
  2. bubenheimer commented on Jan 5, 2024

    @bubenheimer
    ContributorAuthor

    Just as an aside thought, not directly linked to this issue: the initial composition phase of the GoogleMap() subcomposition theoretically would not need to be performed on the main thread, which would free the main thread for other concurrent initialization tasks. This may be too risky to attempt for now.

  3. bubenheimer commented on Jan 7, 2024

    @bubenheimer
    ContributorAuthor

    Another element to consider here: MapsInitializer may need to be a part of an app's map initialization pipeline: the GoogleMap() subcomposition composition phase should not be delayed until after MapsInitializer is done; it can run in parallel.

  4. added a commit that references this issue on Jan 31, 2024
  5. bubenheimer commented on Jan 31, 2024

    @bubenheimer
    ContributorAuthor

    @wangela Just FYI: the 4.3.3 release says that it fixes this issue, but that is not the case. I think this mixup happened because I mentioned this issue in one of the commits for 4.3.3 ("see #501", I was not aware that this has "fixes" semantics, maybe some problem with release automation, or maybe I shouldn't do this in commit messages?).

  6. wangela commented on Feb 27, 2024

    @wangela
    Member

    @bubenheimer Where are you seeing that the release says it fixes this issue 501? I only see it mentioning that it fixes issue 466 which was tagged intentionally on your PR number 478.

  7. bubenheimer commented on Feb 27, 2024

    @bubenheimer
    ContributorAuthor

    @wangela That link says it "closes" #501

  8. wangela commented on Feb 27, 2024

    @wangela
    Member

    Strange, may be human error. I've deleted that mention from the release notes.

  9. bubenheimer commented on May 14, 2024

    @bubenheimer
    ContributorAuthor
  10. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    triage meI really want to be triaged.
    on Feb 24, 2026
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: p2Moderately-important priority. 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