Repository navigation
Description
This is a meta-issue to track reproducible reports of jank in Flutter apps.
If you are experiencing jank in your app:
-
Try to reproduce the problem in a test app. Either run
flutter create janktestand recreate the situation you are experiencing in that app, or clone your app and delete code until you have the jank reproducing with a single .dart file. -
File a bug and include your .dart file demonstrating the problem. If you need more than just a .dart file (for example, assets are needed to reproduce the issue, or plugins/packages are needed to reproduce the issue) then create a GitHub repository and upload the app there.
Make sure to include theflutter doctor -voutput and any logs fromflutter runandflutter analyze. -
Switch flutter to master channel and run this app on a physical device using profile mode with Skia tracing enabled, as follows:
flutter channel master
flutter run --profile --trace-skiaThe bleeding edge master channel is encouraged here because Flutter is constantly fixing bugs and improving its performance. Your problem in an older Flutter version may have already been solved in the master channel.
-
Record a video of the performance issue using another phone so we can have an intuitive understanding of what happened. Don’t use "adb screenrecord", as that affects the performance of the profile run. Attach the video to your bug.
-
Open Observatory and save a timeline trace of the performance issue so we know which functions might be causing it. See "How to Collect and Read Timeline Traces" on this blog post:
https://medium.com/flutter/profiling-flutter-applications-using-the-timeline-a1a434964af3#a499
Make sure that the performance overlay is turned OFF while recording the trace.
Attach the JSON file containing your trace to your bug. You may also wish to include a screenshot of the part of the trace showing the problem you are seeing, just so that people can see at a glance what kind of performance issue the bug is about. -
Mention this bug in your bug, so that GitHub includes a link to it here.
Please avoid commenting on this bug. Keep each issue separate so that we can examine each specific problem individually. Having one issue that contains comments about multiple problems make the issue intractable.
Activity
goderbauer commentedon Jan 28, 2021
May be worthwhile to note that the performance overlay from step 3 should be turned off again when recording the trace in observatory in step 5 as that messes with performance.
dnfield commentedon Jan 29, 2021
The performance overlay is probably not the best thing to recommend here - it actually does incur some performance overhead itself, and on some GPUs it's notable how much. It'd be best to just run the tracing and read that.
kf6gpe commentedon Feb 8, 2021
Triage: Adding team labels so this doesn't come up on the "untriaged" report.
Hixie commentedon Jun 9, 2022
Since we created the performance issue template in issue creation, this hasn't ended up finding any use, so I'm going to close it.
maheshj01 commentedon Aug 18, 2022
This meta issue has been so useful for the triage team.
Hixie commentedon Aug 18, 2022
@maheshmnj good to hear! in what way?
maheshj01 commentedon Aug 19, 2022
It has helped us when triaging performance issues to attach the timeline trace with the triage response and it also acts as a nice guide to point to authors of the issue and everyone else.
Some sample comments where it has helped us
#104709 (comment)
#87811 (comment) (I got to know about this issue here)