Skip to content

Collect unused render targets before asking the embedder to create updated targets. #51229

Open

Description

@chinmaygarde

This will reduce peak memory usage. This optimization must be made when an internal embedder migrates to be resilient to this optimization.

Pessimization added in flutter-team-archive/engine#16711 for b/146142979.

Activity

  1. added
    engineflutter/engine related. See also e: labels.
    on Mar 5, 2020
  2. added
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    on Mar 30, 2020
  3. pedromassangocode commented on Dec 2, 2020

    @pedromassangocode

    Is there a way to verify that this was not fixed yet?

  4. chinmaygarde commented on Dec 2, 2020

    @chinmaygarde
    ContributorAuthor

    Yes. This is still an issue. This is a performance optimization that we should enable to reduce churn in render targets that we request the embedder to allocate for the engine.

  5. ardera commented on Sep 13, 2022

    @ardera
    Contributor

    @chinmaygarde quick ping, has that embedder migrated yet?

  6. chinmaygarde commented on Sep 13, 2022

    @chinmaygarde
    ContributorAuthor

    No. It was harder to achieve in the OpenGL backend. Perhaps we should provide guidance that the embedder use a pool of textures if frequent allocations/deallocations are a concern.

  7. ardera commented on Sep 13, 2022

    @ardera
    Contributor

    @chinmaygarde maybe a collect_and_create_backing_stores callback for the embedder compositor could work? For example, in my scenario I use an EGL window surface as the backing store, and when flutter requests a new backing store, it's hard to tell if I can fill it with the EGL window surface (so FBO with id 0) again because it hasn't been released before.

    This is not a problem with backing store cache enabled or when there's only one view layer. (In the latter case you can just fill it with FBO ID 0 every time, but if there's multiple backing stores to be created you can't do that)

    Definitely possible to work around but still, that'd make things easier

  8. added
    P3Issues that are less important to the Flutter project
    and removed on Jun 28, 2023
  9. added a commit that references this issue on Apr 9, 2024
  10. added a commit that references this issue on Apr 9, 2024
  11. added a commit that references this issue on Apr 22, 2024
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

    P3Issues that are less important to the Flutter projectc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: dream (g3)e: embedderUsers of the Embedder APIengineflutter/engine related. See also e: labels.perf: memoryPerformance issues related to memoryteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions