Skip to content

[Impeller] resizing images is slower than skia. #153623

@leonsavvidi

Description

@leonsavvidi

Steps to reproduce

  1. Turn on impeller for android (flutter 3.24, 3.22 didn't have the problem)
  2. Add multiple jpg with around 100kb (640x320) size to the project
  3. Create multiple Image widgets with caching enabled (cachingHeight: 400)

Expected results

In 3.22 Impeller was decoding and caching lightning fast. Especially if you supply the image data from an isolate.

Actual results

Impeller:
I/flutter (21890): Caching: Enabled. Loaded 27 images in 27909ms
I/flutter (21890): Caching: Disabled. Loaded 27 images in 1516ms

Skia:
I/flutter (23290): Caching: Enabled. Loaded 27 images in 495ms
I/flutter (23290): Caching: Disabled. Loaded 27 images in 422ms

On the Pixel 8 emulator (4 cores) it looks like it's caching 2 images very slowly, then proceeds to the next two ones. Even if you try to decode an image without caching (while the cached ones are processing), it won't show up until the queue is cleared. On a real device with 4perf4eff cores (Samsung a50) it's significantly faster yet still noticeable performance downgrade (3-5 times slower then before). My blind guess is that it may have something to do with flutter/engine#52423
And even without caching, decoding with impeller is now far worse in terms of speed then with Skia.

Code sample

Code sample

https://github.com/leonsavvidi/bug_decoder_caching

Screenshots or Video

Screenshots / Video demonstration
0abXj2N.mp4

Logs

Logs
Restarted application in 1 399ms.
I/flutter ( 3222): Caching: Enabled. Loaded 27 images in 21370ms

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.24.0, on Microsoft Windows [Version 10.0.22635.4010], locale en-EN)
    • Flutter version 3.24.0 on channel stable at C:\Users\Leon\dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 80c2e84975 (3 weeks ago), 2024-07-30 23:06:49 +0700
    • Engine revision b8800d88be
    • Dart version 3.5.0
    • DevTools version 2.37.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Leon\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: D:\Program Files (x86)\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.5)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.5.33627.172
    • Windows 10 SDK version 10.0.17763.0
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and       
      include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK

[√] Android Studio (version 2024.1)
    • Android Studio at D:\Program Files (x86)\Android Studio
    • 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.11+0--11852314)

[√] VS Code (version 1.92.2)
    • VS Code at C:\Users\Leon\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.94.0

[√] Connected device (4 available)
    • sdk gphone16k x86 64 (mobile) • emulator-5554 • android-x64    • Android 15 (API 35) (emulator)
    • Windows (desktop)             • windows       • windows-x64    • Microsoft Windows [Version 10.0.22635.4010]
    • Chrome (web)                  • chrome        • web-javascript • Google Chrome 124.0.6367.158
    • Edge (web)                    • edge          • web-javascript • Microsoft Edge 128.0.2739.22

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

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work liste: impellerImpeller rendering backend issues and features requeststeam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions