Skip to content

[iOS] Ad example app spends a significant amount of time performing software rasterization. #142813

@jonahwilliams

Description

@jonahwilliams

Run the example from https://github.com/lucalooz/flutter_ads_list_perf , I added more ads so that there were at least two on screen at one time. Then I used the package https://github.com/Kelvenbit/FlameGraphs-Instruments to capture a flame graph from an instruments trace.

While most frames are pretty fast occassionally, we get some slow ones. It might look something like this:

image

This extra time is (according to the flame graph) spent in CATransactionCommit. We can see that a large portion of this time is spent in software routines that look like they are doing software rasterization. This is highly suspicious - software rasterization is slow. This also doesn't appear to be done because of Flutter's rendering or the webview rendering.

image

On a whim, I disabled the mutators stack and this part of the trace complete disappeared. I suspect that the way we are using MaskViews, or something in the mutators is triggering this code. Unfortunately due to the nature of CATransactions, we can't really follow the callstack directly to see what was triggering it.

I would investigate if a particular mutator is triggering this software rasterization path, and/if this operation is even necessary. After all, these views don't appear to be clipped.

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

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions