Skip to content

[ios][platform_view]Optimize the double for loop in platform view overlay computation #145802

@hellohuanlin

Description

@hellohuanlin

There's a double loop in the overlay computation logic which can be expensive:

https://github.com/flutter/engine/blob/5a12de1beab71c44692e7b12e7fdf3f5f3702f06/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm#L698-L705

For example, some of the intermediate rect structs can be cashed for re-use.

More context: flutter/engine#51687 (comment)

CC @flar

Creating a separate issue since it's the existing behavior. We should keep the original PR atomic, and have a separate PR for this, so that we can measure the improvement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions