Skip to content

OpenContainer jank due to multiple frames of shader compilation #76180

@danReynolds

Description

@danReynolds

This issue has attracted significant attention, and the continuous stream of comments has been very distracting to to the team. Please read our guidelines on participating in issues before commenting on this issue.

Hello! Thanks for taking a time to look into the issue of jank with animations on iOS using the Metal shader API. It's an issue that a lot of folks have reported as per major threads here:

#32170
#74824
#74631

and I wanted to try and help by giving a clear example as per the guideline for this jank here:
#74833

System info

Device: iPhone 12 mini

Screen Shot 2021-02-16 at 11 50 22 PM

Source code

Demo lib is available here:
https://github.com/danReynolds/iosjank

It is a barebones flutter create app with a single dart file modified:
https://github.com/danReynolds/iosjank/blob/master/lib/main.dart

The animation it uses is from the OpenContainer component supplied by flutter here:
https://github.com/flutter/packages/blob/master/packages/animations/lib/src/open_container.dart

Video

A video of the jank is available here:
https://photos.google.com/share/AF1QipOIN6m7QjsVUf63zeMXriQW0pg_npG3e0mwBnzV_TojsNzN4kEpXzFiKC6vVRrUzg?key=Wk96RzBNdnFTRF8xTDVkV08yRGFlZHdxMktSUWRR

note how the animation of the floating button lags the first couple times on open/close.

Trace

A trace is available here: https://drive.google.com/file/d/1RhWnX_zytL_1KWjHtOxx0Ji_3Z-idRw3/view?usp=sharing

which was recorded as per the instructions here: https://medium.com/flutter/profiling-flutter-applications-using-the-timeline-a1a434964af3#a499

In Summary

I hope this example illustrates how the issue of iOS jank with Metal is pervasive in the most basic of apps with performant animations provided by the Flutter library itself. If there is anything more I can provide to help debug this issue I will do whatever it takes, so please let me know.

This is the biggest issue facing my organization's Flutter application and both our org and devs from other companies I've spoken to are considering moving away from Flutter if this problem is not resolved soon or given a timeline for being resolved in upcoming releases. I don't mean to be overly harsh, it's just a fact that we need robust performance on iOS in order for our application to succeed as a product.

Overall I've greatly enjoyed working with Flutter and would love to keep using and evangelizing it in the future. Thanks to everyone involved with this project. ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)c: renderingUI glitches reported at the engine/skia or impeller rendering levelcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.engineflutter/engine related. See also e: labels.perf: speedPerformance issues related to (mostly rendering) speedplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions