-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenContainer jank due to multiple frames of shader compilation #76180
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thank you @danReynolds for filing a fantastically precise and reproducible bug. Much appreciated. This will significantly help in addressing the issue. |
Weird, the timeline doesn't seem to show the bad frames I see on the video. Investigating further... |
Yea I've never used the tracer before so let me know if I missed something. We can chat on Discord and I can always redo it tonight if something is amiss. |
Trying this on the ancient Android tablet I have on my desk I do see the same jank there, FWIW. So this may not be iOS-specific. |
Ah interesting, yea my Pixel 3 runs slick but my new iPhone 12 is laggy on this and other animations so it's at least more of an issue on iOS. Let me know what the trace reveals |
This comment has been minimized.
This comment has been minimized.
Work on 77412 continues and progress is looking good, but as noted in that issue, it's a long-term project (basically rewriting Skia) so it'll take a while. Nothing particular to report yet. |
Hi @Hixie have you made any progress you can share on this ? |
Significant progress on 77412 continues to be made; the experimental branch just landed into the engine repo on Friday in fact. It'll still be many more months before this work is in a stable release though. It's basically a rewrite of our graphics backend, which is definitely a non-trivial effort. |
@Hixie Can you link the branch in the engine repo here? I would love to dig into it. |
|
It was recently announced that Impeller is now included in Flutter 3.7 with initial support for iOS: https://github.com/flutter/engine/tree/main/impeller#try-impeller-in-flutter |
@chinmaygarde I think we should consider closing this issue. The 90th percentile raster time should be an accurate measurement of jank since jank can be thought of as The grey line is impeller and the orange line is skia (link). Impeller has been turned on by default for iOS since 3.10. This issue seems to be focused on iOS, so there is no need to gate it on any work for Android. I believe the jank issue manifested more on iOS. If we decide not to close this now I think we should come up with good exit criteria for the issue, maybe file a separate issue for Android if we want. |
Yeah this is definitely fixed! If there are similar issues please don't hesitate to file new bugs and include as much detail as possible (including ideally code to reproduce the problem, precise steps for doing so, and maybe a video showing the problem, if that is possible). |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
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
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. ❤️
The text was updated successfully, but these errors were encountered: