Description
I noticed a performance regression when switching to the latest stable (1.20). It happens when animating images (for example during hero animation, or when programmatically zooming in/out in something like InteractiveViewer
). It is particularly noticeable in debug mode, on low-end devices and with larger images (say >5 MB). In profile mode, performances are way better but we can still observe a regression compared to the previous flutter versions.
Specifically, this engine roll brought the issue: #58751
but I don't know enough about Skia and the engine to dig deeper...
I made a simple repro project:
https://github.com/deckerst/flutter_image_anim_regression
Here's a video record of this repro built with a recent master commit of Flutter (notice the jank), and another record built with Flutter v1.19.0-3.0.pre (smooth like butter). Both are records from debug mode, because it's easier to see, but as I said there is also a regression in profile mode.
It happens with physical Android devices and emulators. I can't say whether it happens on iOS.
edit: here's a timeline taken in profile mode with current Flutter master, on a Sony Xperia Z5 Compact (E5823):
dart_devtools_2020_8_16-1597547958570000.json.zip
Target Platform:
Android
Target OS version/browser:
7.1.1 (API 25), 10 (API 29)
Devices:
Sony Xperia Z5 Compact (E5823), Samsung Galaxy S10e (SM-G970N)
flutter doctor -v
[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G73, locale en-KR)
• Flutter version 1.20.2 at /Users/thibault/code/flutter
• Framework revision bbfbf1770c (2 days ago), 2020-08-13 08:33:09 -0700
• Engine revision 9d5b21729f
• Dart version 2.9.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at /Users/thibault/Library/Android/sdk
• Platform android-30, build-tools 30.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[!] IntelliJ IDEA Ultimate Edition (version 2020.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[!] VS Code (version 1.47.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• E5823 (mobile) • CB5A28Q7EL • android-arm64 • Android 7.1.1 (API 25)
• sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
! Doctor found issues in 2 categories.