[Performance] The app is very slow and has stuttering animation
Performance bug I downloaded the Play Store app on my real device Samsung Galaxy S8+ running Android 9 and noticed some jank and poor performance in the app, After this, I run the app in release mode in my iPhone 6s (real device), and again same performance issues. Later on, I run the app in macOS but this time it worked and I was able to get 60fps. So, it only worked on my mac machine.
Flutter doctor
[✓] Flutter (Channel dev, 1.19.0-1.0.pre, on Mac OS X 10.15.1 19B88, locale
en-GB)
• Flutter version 1.19.0-1.0.pre at /Users/planet/Work/flutter
• Framework revision 456d80b9dd (5 days ago), 2020-05-11 11:45:03 -0400
• Engine revision d96f962ca2
• Dart version 2.9.0 (build 2.9.0-7.0.dev 092ed38a87)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/planet/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.2.1, Build version 11B500
• CocoaPods version 1.8.4
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build
1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.44.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.9.1
[✓] Connected device (4 available)
• iPad Pro • b1910da0802b3d6e38b23a455f95878f0ca87733 • ios •
iOS 13.2.3
• macOS • macOS • darwin-x64 •
Mac OS X 10.15.1 19B88
• Web Server • web-server • web-javascript •
Flutter Tools
• Chrome • chrome • web-javascript •
Google Chrome 80.0.3987.149
• No issues found!
To Reproduce
- Open the app, navigate to any page under Material, Cupertino or Styles option
- You see a jank, the fps drops down to something maybe 20-30 fps for few milliseconds.
- After you have successfully navigated to those pages 2-3 times, they seem to work fine.
- Similarly clicking on menu icon (on home page) first time, drops the fps and later on it works.
Expected behavior It should have 60fps on all the platforms.
Desktop (please complete the following information):
- macOS v10.15.1
Smartphone (please complete the following information):
- Samsung Galaxy S8+ (Android 9)
- iPhone 6s (13.2.3)
I can concur - on my own S7 Edge - both the play store version & my own built (profile mode / release mode) app - almost none of the frames are rendered under 16 ms. Most around the 16-20 ms mark with huge spikes that cause jank.
It doesn't make the app unusable but considering that a big selling point for flutter is 60Hz animation and that this is the entry point for a lot of people when it comes to evaluating flutter as a development platform, I think it could put some people off to see the highlight gallery app have suboptimal performance.
How can we minimize the UI & GPU impact?
Tested On KDE/X11/Archlinux with i7-8565U and Android 10 Sandragon 655 which are reasonably good hardware. Defiantly not smooth 60 fps as advertised
There's no benefit in leaving a comment if you can't upvote the issue
@mthan160 @kafein @federico-terzi @pepijndevos and @LastLightSith
This is what we call early-onset jank. There are two projects in Flutter that mean to address this for all apps, so I'll close this since there's nothing actionable to do for the gallery specifically.
If there's a specific part of the app that isn't performant, please open a new issue.