Skip to content
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

[Impeller] performance issue on specific lottie files. #141961

Closed
Tracked by #143077
desmeit opened this issue Jan 22, 2024 · 19 comments
Closed
Tracked by #143077

[Impeller] performance issue on specific lottie files. #141961

desmeit opened this issue Jan 22, 2024 · 19 comments
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) found in release: 3.16 Found to occur in 3.16 found in release: 3.19 Found to occur in 3.19 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version team-engine Owned by Engine team triaged-engine Triaged by Engine team

Comments

@desmeit
Copy link

desmeit commented Jan 22, 2024

Steps to reproduce

  1. Install 3.16+ flutter
  2. Install newest lottie 3.0.0 for flutter
  3. take a bit more complex lottie file

Actual results

Under 3.7.12 I had no problems with more complex Lottie files of around 1 MB.
With the update to 3.16 I have the problem that the lotties are jerky and all animations no longer run smoothly. There seems to be a big performance problem with lottie. I have also noticed a similar problem with slightly larger SVG files.

with Lottie:

RPReplay_Final1705926939.MP4

without Lottie:

RPReplay_Final1705926988.MP4

Logs

Logs
[✓] Flutter (Channel stable, 3.16.5, on macOS 14.1.2 23B92 darwin-arm64, locale de-DE)
    • Flutter version 3.16.5 on channel stable at /Users/xxx/development/tools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (vor 5 Wochen), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/xxx/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/xxx/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/xxx/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.85.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (3 available)
    • xxx iPhone (mobile) • 00008130-000A49440230001C • ios            • iOS 17.2.1 21C66
    • macOS (desktop)         • macos                     • darwin-arm64   • macOS 14.1.2 23B92 darwin-arm64
    • Chrome (web)            • chrome                    • web-javascript • Google Chrome 120.0.6099.234
    ! Error: Browsing on the local area network for xxx iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area
      network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.16.5, on macOS 14.1.2 23B92 darwin-arm64, locale de-DE)
    • Flutter version 3.16.5 on channel stable at /Users/xxx/development/tools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (vor 5 Wochen), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/xxx/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/xxx/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/xxx/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.85.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (3 available)
    • xxx iPhone (mobile) • 00008130-000A49440230001C • ios            • iOS 17.2.1 21C66
    • macOS (desktop)         • macos                     • darwin-arm64   • macOS 14.1.2 23B92 darwin-arm64
    • Chrome (web)            • chrome                    • web-javascript • Google Chrome 120.0.6099.234
    ! Error: Browsing on the local area network for xxx iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area
      network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@appinteractive
Copy link

We experience the exact same issue after upgrading from 3.10. it's janky on all versions between 3.13 and 3.19. Newer version of Lottie (3.0) does not help either.

@appinteractive
Copy link

related #140257

@huycozy
Copy link
Member

huycozy commented Jan 23, 2024

Hi @desmeit
For us to further investigate this issue, please provide a completed and minimal reproducible code sample that doesn’t include 3rd party plugins or complex production code so that we may verify this.

Also, could you check if this issue persists without using Impeller?

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 23, 2024
@desmeit
Copy link
Author

desmeit commented Jan 23, 2024

Hi @huycozy,

thanks for your feedback. Here you can find the minimal example: https://we.tl/t-sparN7Z567
I tested it also without impeller and it looks much better.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 23, 2024
@huycozy
Copy link
Member

huycozy commented Jan 24, 2024

Thanks for the update. I checked this on both iOS and Android app and the results as below. Janks and rasters are observed when disabling Impeller as well (it's less on iOS, though)

iOS (iPhone 7, iOS 15.8)

Android (Pixel 7, Android 14)

  • Without Impeller:
    Screenshot 2024-01-24 at 11 37 44
  • With Impeller:
    Screenshot 2024-01-24 at 11 39 52
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.16.8, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.16.8 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 67457e669f (27 hours ago), 2024-01-16 16:22:29 -0800
    • Engine revision 6e2ea58a5c
    • Dart version 3.2.5
    • DevTools version 2.28.5

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio Hedgehog.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.85.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (3 available)
    • iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.8 19H370
    • macOS (desktop) • macos                                    • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)    • chrome                                   • web-javascript • Google Chrome 120.0.6099.234

[✓] Network resources
    • All expected network resources are available.

• No issues found!
[!] Flutter (Channel master, 3.19.0-9.0.pre.50, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.19.0-9.0.pre.50 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dea6b994e (10 hours ago), 2024-01-21 12:01:23 -0500
    • Engine revision a7b207d5a1
    • Dart version 3.4.0 (build 3.4.0-52.0.dev)
    • DevTools version 2.31.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio Hedgehog.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.85.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 120.0.6099.234
    ! Error: iPhone has recently restarted. Xcode will continue when iPhone is unlocked. (code -14)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@huycozy huycozy added platform-android Android applications specifically platform-ios iOS applications specifically engine flutter/engine repository. See also e: labels. c: performance Relates to speed or footprint issues (see "perf:" labels) has reproducible steps The issue has been confirmed reproducible and is ready to work on team-engine Owned by Engine team found in release: 3.16 Found to occur in 3.16 found in release: 3.19 Found to occur in 3.19 c: regression It was better in the past than it is now and removed in triage Presently being triaged by the triage team labels Jan 24, 2024
@huycozy huycozy changed the title Big performance issue with Lottie and 3.16 Big performance issue with complex Lottie files of around 1 MB Jan 24, 2024
@appinteractive
Copy link

appinteractive commented Jan 24, 2024

We experience the same issues with multiple small Lottie files too. Do it's not limited to single large files.

@jonahwilliams jonahwilliams added P1 High-priority issues at the top of the work list and removed c: regression It was better in the past than it is now engine flutter/engine repository. See also e: labels. labels Jan 29, 2024
@jonahwilliams jonahwilliams self-assigned this Jan 29, 2024
@jonahwilliams jonahwilliams changed the title Big performance issue with complex Lottie files of around 1 MB [Impeller] performance issue on specific lottie files. Jan 29, 2024
@jonahwilliams jonahwilliams added the triaged-engine Triaged by Engine team label Jan 29, 2024
@jonahwilliams
Copy link
Member

Similar to existing lottie performance issues: tessellation overhead is substantial.

image

See #137714 for the effort to fix this

@jonahwilliams
Copy link
Member

FYI @zanderso

@jonahwilliams jonahwilliams removed their assignment Jan 29, 2024
@jonahwilliams jonahwilliams added P2 Important issues not at the top of the work list and removed P1 High-priority issues at the top of the work list labels Jan 29, 2024
@zanderso
Copy link
Member

FYI @bdero thought this might be interesting to validate StC work when it is closer to completion, but if you already have some examples in mind, then that is fine, too.

@jonahwilliams
Copy link
Member

@desmeit can you upload that project somewhere like Github where the link won't expire. I'm going back to check on some changes we're making but now I can no longer find this project.

@desmeit
Copy link
Author

desmeit commented Feb 12, 2024

@desmeit
Copy link
Author

desmeit commented Feb 20, 2024

@jonahwilliams

Just one question:

While we wait for the fix, is it possible to build the app without impeller?

Of course I know
flutter run --no-enable-impeller

But is it also possible to build the release in the old way with SkSL warmup?

@zanderso
Copy link
Member

@desmeit instructions are under https://docs.flutter.dev/perf/impeller#availability.

@desmeit
Copy link
Author

desmeit commented Feb 21, 2024

thanks. Warmup ist also working with this tag.

auto-submit bot pushed a commit to flutter/engine that referenced this issue Mar 5, 2024
bdero added a commit to bdero/flutter-engine that referenced this issue Mar 5, 2024
auto-submit bot pushed a commit to flutter/engine that referenced this issue Mar 5, 2024
auto-submit bot added a commit to flutter/engine that referenced this issue Mar 5, 2024
… path rendering. (#51209)" (#51217)

Reverts #51209
Initiated by: bdero
Reason for reverting: Golden breakages on [engine roll](flutter/flutter#144647) https://flutter-gold.skia.org/search?issue=144647&crs=github&patchsets=5&corpus=flutter
Original PR Author: bdero

Reviewed By: {jonahwilliams, chinmaygarde}

This change reverts the following previous change:
Original Description:
Turn the page, wash your hands.

Addresses the following issues:
* flutter/flutter#143077
* flutter/flutter#137714
* flutter/flutter#138460
* flutter/flutter#123671
* flutter/flutter#141961
* flutter/flutter#134432

Previous attempt:
- #50856
    - reverted with #51191
    - fixed with #51198
bdero added a commit to bdero/flutter-engine that referenced this issue Mar 6, 2024
auto-submit bot pushed a commit to flutter/engine that referenced this issue Mar 6, 2024
…dering. (#51219)

Turn the page, wash your hands.

Addresses the following issues:
* flutter/flutter#143077
* flutter/flutter#137714
* flutter/flutter#138460
* flutter/flutter#123671
* flutter/flutter#141961
* flutter/flutter#134432

Previous attempts:
1. #50856
    - reverted with #51191
    - fixed with #51198
2. #51209
    - reverted with #51217
    - fixed with #51218
@jonahwilliams
Copy link
Member

Before

4F1A0977-EA58-45F7-B105-A44178B6EC40_1_102_o

After

BBB8B0E9-6183-4514-875C-E3D403556380_1_102_a

@appinteractive
Copy link

Awesome 👏 when can the update be expected to land? 🛬

@zanderso
Copy link
Member

zanderso commented Mar 8, 2024

@appinteractive It's available on the master channel now, and should be in the April beta release, and Q2 stable release, exact dates TBA.

@bdero
Copy link
Member

bdero commented Apr 2, 2024

This performance gap was fixed with stencil-then-cover. See also: #143077

@bdero bdero closed this as completed Apr 2, 2024
@huycozy huycozy added the r: fixed Issue is closed as already fixed in a newer version label Apr 3, 2024
Copy link

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) found in release: 3.16 Found to occur in 3.16 found in release: 3.19 Found to occur in 3.19 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version team-engine Owned by Engine team triaged-engine Triaged by Engine team
Projects
None yet
Development

No branches or pull requests

6 participants