Repository navigation
Description
Hi!
CPU usage goes through the roof when I run a simple animation on Linux Desktop. Please find the minimum sample app below. I ran the same code on a Windows machine where this problem does not occur. I've don't have access to a Mac to test it there.
When running the app with the profiler enabled I've noticed that the FPS is at 60 FPS all the time but visually the animation is quite janky. It only gets better marginally when run in release mode. This might be a clue that the problem occurs when presenting the frame to the screen?
I've verified that the graphics drivers work well on my Linux system by running a the same game on Linux and Windows. They ran at nearly the same FPS.
I've tried both, the stable and master channels with the same results.
All tests are ran on the same machine which is dual booted between Linux / Windows
edit: added more hardware / software info
CPU usage on Linux:
-
Linux, no animation: all 8 cores are used at around 5 %, matching Windows

-
Linux, with animimation, Vivaldi browser smooth animation, normal CPU usage

-
Windows, with animation: all 8 cores are used at around 5-10 %

Details
Code to reproduce. This is a standard flutter create project with the counter text replaced with a CircularProgressIndicator()
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: const Center(
child: CircularProgressIndicator(),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}Target Platform: Linux Desktop
Target OS version/browser: Ubuntu 21.10 (Regolith Linux flavor)
Devices: amd64 platform
Logs
Logs
fusion44@fusion44-UM700:~/dev/stuff/bug$ flutter run --profile -v
[ +73 ms] executing: uname -m
[ +37 ms] Exit code 0 from: uname -m
[ ] x86_64
[ +6 ms] executing: [/home/fusion44/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +7 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] c860cba910319332564e1e9d470a17074c1f2dfd
[ ] executing: [/home/fusion44/snap/flutter/common/flutter/] git tag --points-at c860cba910319332564e1e9d470a17074c1f2dfd
[ +17 ms] Exit code 0 from: git tag --points-at c860cba910319332564e1e9d470a17074c1f2dfd
[ ] 2.10.4
[ +13 ms] executing: [/home/fusion44/snap/flutter/common/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +7 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/stable
[ ] executing: [/home/fusion44/snap/flutter/common/flutter/] git ls-remote --get-url origin
[ +7 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +88 ms] executing: [/home/fusion44/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD
[ +6 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ +59 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +60 ms] executing: /home/fusion44/Android/Sdk/platform-tools/adb devices -l
[ +59 ms] List of devices attached
[ +7 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ +2 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +131 ms] Skipping pub get: version match.
[ +79 ms] Generating /home/fusion44/dev/stuff/bug/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +97 ms] Launching lib/main.dart on Linux in profile mode...
[ +17 ms] Building Linux application...
[ +8 ms] executing: [build/linux/x64/profile/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Profile -DFLUTTER_TARGET_PLATFORM=linux-x64 /home/fusion44/dev/stuff/bug/linux
[ +42 ms] -- Configuring done
[ +4 ms] -- Generating done
[ ] -- Build files have been written to: /home/fusion44/dev/stuff/bug/build/linux/x64/profile
[ +5 ms] executing: ninja -C build/linux/x64/profile install
[ +8 ms] ninja: Entering directory `build/linux/x64/profile'
[+1944 ms] [1/5] Generating /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/libflutter_linux_gtk.so, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h,
/home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_engine.h,
/home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h,
/home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_method_call.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h,
/home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_method_response.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h,
/home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h,
/home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_value.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/fl_view.h, /home/fusion44/dev/stuff/bug/linux/flutter/ephemeral/flutter_linux/flutter_linux.h, _phony_
[ +6 ms] [ +65 ms] executing: uname -m
[ ] [ +34 ms] Exit code 0 from: uname -m
[ ] [ ] x86_64
[ ] [ +5 ms] executing: [/home/fusion44/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] [ +6 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] [ ] c860cba910319332564e1e9d470a17074c1f2dfd
[ ] [ ] executing: [/home/fusion44/snap/flutter/common/flutter/] git tag --points-at c860cba910319332564e1e9d470a17074c1f2dfd
[ ] [ +23 ms] Exit code 0 from: git tag --points-at c860cba910319332564e1e9d470a17074c1f2dfd
[ ] [ ] 2.10.4
[ ] [ +9 ms] executing: [/home/fusion44/snap/flutter/common/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ ] [ +6 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] [ ] origin/stable
[ ] [ ] executing: [/home/fusion44/snap/flutter/common/flutter/] git ls-remote --get-url origin
[ ] [ +5 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] [ ] https://github.com/flutter/flutter.git
[ ] [ +54 ms] executing: [/home/fusion44/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD
[ ] [ +4 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] [ ] stable
[ ] [ +49 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] [ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] [ +90 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ ] [ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ ] [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] [ +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ ] [ +79 ms] Initializing file store
[ ] [ +8 ms] Done initializing file store
[ ] [ +42 ms] Skipping target: gen_localizations
[ ] [ +10 ms] Skipping target: gen_dart_plugin_registrant
[ ] [ +256 ms] Skipping target: unpack_linux
[ ] [ +306 ms] Skipping target: kernel_snapshot
[ ] [ +30 ms] Skipping target: aot_elf_profile
[ ] [ +28 ms] Skipping target: linux_aot_bundle
[ ] [ +28 ms] Skipping target: profile_bundle_linux-x64_assets
[ ] [ ] Persisting file store
[ ] [ +8 ms] Done persisting file store
[ ] [ +4 ms] build succeeded.
[ ] [ +7 ms] "flutter assemble" took 929ms.
[ ] [ +3 ms] Running shutdown hooks
[ ] [ ] Shutdown hooks complete
[ ] [ +3 ms] exiting with code 0
[ +418 ms] [2/5] Building CXX object CMakeFiles/bug.dir/flutter/generated_plugin_registrant.cc.o
[ +61 ms] [3/5] Building CXX object CMakeFiles/bug.dir/my_application.cc.o
[ +168 ms] [4/5] Linking CXX executable intermediates_do_not_run/bug
[ ] /snap/flutter/current/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
[ +1 ms] [4/5] Install the project...
[ +12 ms] -- Install configuration: "Profile"
[ +4 ms] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/bug
[ ] -- Set runtime path of "/home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/bug" to "$ORIGIN/lib"
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/icudtl.dat
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/lib/libflutter_linux_gtk.so
[ +18 ms] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/version.json
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/packages
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/packages/cupertino_icons
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/packages/cupertino_icons/assets
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/FontManifest.json
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/NOTICES.Z
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/fonts
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/fonts/MaterialIcons-Regular.otf
[ +1 ms] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/data/flutter_assets/AssetManifest.json
[ ] -- Installing: /home/fusion44/dev/stuff/bug/build/linux/x64/profile/bundle/lib/libapp.so
[ +20 ms] Building Linux application... (completed in 2.725ms)
[ +152 ms] Observatory URL on device: http://127.0.0.1:34923/ZLyJK_2OVGY=/
[ +15 ms] Connecting to service protocol: http://127.0.0.1:34923/ZLyJK_2OVGY=/
[ +138 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:34923/ZLyJK_2OVGY=/.
[ +107 ms] DDS is listening at http://127.0.0.1:42571/wEavpuc77xs=/.
[ +66 ms] Successfully connected to service protocol: http://127.0.0.1:34923/ZLyJK_2OVGY=/
[ +9 ms] Application running.
[ +32 ms] Connected to Linux
[ +2 ms] Flutter run key commands.
[ +2 ms] h List all available interactive commands.
[ +2 ms] c Clear the screen
[ ] q Quit (terminate the application on the device).
[ +3 ms] An Observatory debugger and profiler on Linux is available at: http://127.0.0.1:42571/wEavpuc77xs=/
[ +167 ms] The Flutter DevTools debugger and profiler on Linux is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:42571/wEavpuc77xs=/
fusion44@fusion44-UM700:~/dev/stuff/bug$ flutter doctor -v
[✓] Flutter (Channel stable, 2.10.4, on Ubuntu 21.10 5.13.0-39-generic, locale de_DE.UTF-8)
• Flutter version 2.10.4 at /home/fusion44/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c860cba910 (vor 2 Wochen), 2022-03-25 00:23:12 -0500
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /home/fusion44/Android/Sdk
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
• cmake version 3.10.2
• ninja version 1.8.2
• pkg-config version 0.29.1
[✓] Android Studio (version 2021.1)
• Android Studio at /snap/android-studio/119/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 11.0.11+0-b60-7590822)
[✓] VS Code
• VS Code at /snap/code/current
• Flutter extension version 3.38.1
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Ubuntu 21.10 5.13.0-39-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.75
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.


Activity
maheshj01 commentedon Apr 11, 2022
Hi @fusion44, thanks for filing the issue. I am able to reproduce the issue on stable and the master channel. The CPU usage with just circular progress indicator animating is pretty high. On avergae I saw the usage was at 35% and sometimes as high as 45%.
The below screenshot shows the flutter app (Linux_test) using 36% CPU usage
Here's the timeline trace from the master channel in debug mode, if this can help figure out the issue.
flutter doctor -v (Linux)
13 remaining items
flutter-triage-bot commentedon Jun 6, 2024
The
triaged-desktoplabel is irrelevant if there is noteam-desktoplabel orfyi-desktoplabel.spydon commentedon Jul 1, 2024
I tried on Wayland with the reproduction code and I see a CPU usage of 25% when it is idle (higher than Firefox with lots of tabs open for example).
Then it goes up to around 50% when resizing the window and it also goes up to 30-35% when you just move around the mouse quickly over the application.
alphaqu commentedon Oct 19, 2024
I am also experiencing this slowdown. On linux, wayland + hyprland.
On removal of the animation controller code in initState, my cpu usage for the flutter application drops from 20% to 0.1%.
Perf profilings
Here are two profiling ive done with
perf, (in a format which is openable by profiler.firefox.com), one with the code above, and another with the controller stuff commented out.with_animation.txt
without_animation.txt
lhoward commentedon Mar 3, 2025
I believe we’re seeing something similar using the Sony embedder (OpenGL, no Impeller) both on desktop with Wayland, and embedded CM4 with DRM.
Cc @prspn
Qubitus commentedon Mar 26, 2025
I have the same issue, high CPU usage on idle (only displaying an application window).
Just for info, when deployed to the browser I get a steady 60 FPS without any drops.
When deployed as native Linux app, the FPS for full screen (4k) gets stuck at 10 FPS.
The smaller I make the window, the higher the FPS counter goes.
Nvidia hardware acceleration enabled and used... so seems something is choking CPU.
bochelie1000 commentedon Jul 23, 2025
I also have the same issue on Linux Desktop. No matter what type of animation or its size ect. It always uses >45% CPU as soon an animation is used.
I see that this issue is very old. Will this be investigated?
dreirund commentedon Jun 28, 2026
Still relevant.
dongfengweixiao commentedon Jun 30, 2026
When playing videos on Linux using media_kit or other video playback components, the CPU usage can reach 20% or higher. In contrast, playing the same video with the mpv player typically results in only 5% CPU usage. This discrepancy is likely related to the underlying reasons for the differences in CPU efficiency between these video playback methods.
spydon commentedon Oct 25, 2026
We have been having problems with this in Flame for ages, on Flutter main this is way better after @robert-ancell's work on the subsurface based view renderer though! I added another PR on top of his works that makes it on par with the other platforms.