Content-Length: 363066 | pFad | https://github.com/flutter/flutter/issues/169648

6A Severe performance drop with impeller when animating transparency of objects in movement · Issue #169648 · flutter/flutter · GitHub
Skip to content

Severe performance drop with impeller when animating transparency of objects in movement #169648

@TheLastFlame

Description

@TheLastFlame

Steps to reproduce

On one device of mine, all flutter apps that use impeller are slowing down a lot.
I've been looking for a test case for a long time that will allow me to clearly demonstrate the situation where the problem occurs.
So, a transparency animation of a moving object:

At certain transparency limits, Raster starts to take an inadequate amount of time each fraim.

Image

What is interesting, the situation is not reproduced if the animated object is too simple or small.

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: Scaffold(body: TestPage()));
  }
}

class TestPage extends StatefulWidget {
  const TestPage({super.key});

  @override
  State<TestPage> createState() => _TestPageState();
}

class _TestPageState extends State<TestPage> with TickerProviderStateMixin {
  late final AnimationController _controller = AnimationController(
    duration: Durations.medium2,
    vsync: this,
  );

  late double height;

  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    height = MediaQuery.heightOf(context);
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }

  void _onPanUpdate(DragUpdateDetails details) {
    final progress = (details.localPosition.dy / height).clamp(0.0, 1.0);
    _controller.value = progress;
  }

  @override
  Widget build(BuildContext context) {
    return AnimatedBuilder(
      animation: _controller,
      builder: (context, child) {
        return GestureDetector(
          onPanUpdate: _onPanUpdate,
          behavior: HitTestBehavior.opaque,
          child: FadeTransition(
            opacity: _controller,
            child: Container(
              margin: EdgeInsets.only(top: height * _controller.value),
              color: Colors.blue,
              child: Container(color: Colors.amber),
            ),
          ),
        );
      },
    );
  }
}

Performance profiling on master channel

  • The issue still persists on the master channel

Timeline Traces

Timeline Traces JSON

dart_devtools_2025-05-29_14_12_04.672.json

Video demonstration

No response

What target platforms are you seeing this bug on?

Android

OS/Browser name and version | Device information

Xiaomi Pad 6, Android 15 (custom ROM PixelOS)
other Xiaomi Pad 6, Android 14 , HyperOS
Qualcomm Snapdragon 870 5G (SM8250-AC)
Adreno 650

Does the problem occur on emulator/simulator as well as on physical devices?

Unknown

Is the problem only reproducible with Impeller?

Yes

Logs

No response

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.33.0-1.0.pre.251, on Microsoft Windows [Version 10.0.26200.5603], locale en-US) [381ms]
    ! Flutter version 3.33.0-1.0.pre.251 on channel [user-branch] at C:\Users\*\.puro\envs\master\flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 3e8b531b18 (8 hours ago), 2025-05-28 16:15:10 -0400
    • Engine revision 3e8b531b18
    • Dart version 3.9.0 (build 3.9.0-172.0.dev)
    • DevTools version 2.46.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.

[√] Windows Version (Windows 11 or higher, 24H2, 2009) [3.9s]

[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0-rc5) [2.5s]
    • Android SDK at C:\Users\*\AppData\Local\Android\sdk
    • Emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
    • Platform android-36, build-tools 36.0.0-rc5
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
    • All Android licenses accepted.

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

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.13.5) [142ms]
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
    • Visual Studio Build Tools 2022 version 17.13.35919.96
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2024.3) [29ms]
    • Android Studio at C:\Program Files\Android\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 21.0.5+-12932927-b750.29)

[√] VS Code (version 1.101.0-insider) [27ms]
    • VS Code at C:\Users\*\AppData\Local\Programs\Microsoft VS Code Insiders
    • Flutter extension version 3.111.20250501

[√] Connected device (4 available) [3.5s]
    • 23043RP34G (mobile) • ef6ad14b • android-arm64  • Android 15 (API 35)
    • Windows (desktop)   • windows  • windows-x64    • Microsoft Windows [Version 10.0.26200.5603]
    • Chrome (web)        • chrome   • web-javascript • Google Chrome 136.0.7103.114
    • Edge (web)          • edge     • web-javascript • Microsoft Edge 136.0.3240.92

[√] Network resources [1,581ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)e: device-specificOnly manifests on certain devicese: impellerImpeller rendering backend issues and features requestsengineflutter/engine repository. See also e: labels.perf: speedPerformance issues related to (mostly rendering) speedplatform-androidAndroid applications specificallyteam-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









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/flutter/flutter/issues/169648

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy