-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)platform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-windowsOwned by the Windows platform teamOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform teamTriaged by the Windows platform team
Description
Steps to reproduce
-
Run a simple Windows Flutter app on 3.35.0.
-
Observe FPS without doing anything.
-
Do some input (drag mouse) and notice FPS briefly goes up.
Expected results
App should run stable at the monitor refresh rate.
Actual results
My monitor refresh rate is 165Hz, but the app usually runs only 60–70 FPS.
When I interact with the app (like mouse dragging), the FPS jumps up to full refresh rate.
Because of this, animations feel not smooth. Before interaction, they are slower, after interaction they suddenly jump, it looks visually laggy. I am making a game with animations, so this problem is very noticeable for me。
Code sample
Code sample
import 'package:flame/game.dart';
import 'package:flutter/material.dart';
import 'package:flame/components.dart';
// Example using flame engine -> flame: ^1.30.1
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(body: GameWidget(game: MyGame())),
);
}
}
class MyGame extends FlameGame {
late MyRectangle _rectangle;
late FpsTextComponent _fps;
MyGame({super.camera});
@override
Future<void> onLoad() async {
super.onLoad();
await _addComponents();
}
@override
void onGameResize(Vector2 size) {
super.onGameResize(size);
if (isMounted) {
_rectangle.position = size / 2;
_fps.position = size / 2;
}
}
Future<void> _addComponents() async {
_rectangle = MyRectangle(position: size / 2, size: Vector2(size.x / 2, 10));
add(_rectangle);
_fps = FpsTextComponent(position: size / 2, anchor: Anchor.center);
add(_fps);
}
}
class MyRectangle extends RectangleComponent {
final double rotationSpeed;
MyRectangle({
super.position,
required super.size,
Anchor? anchor,
this.rotationSpeed = 60.0,
}) : super(anchor: anchor ?? Anchor.center);
@override
void update(double dt) {
super.update(dt);
angle += rotationSpeed * dt;
}
}
Screenshots or Video
Video demonstration
Note: The videos are a side-by-side comparison of two Windows apps. The left side uses Flutter 3.35.0, and the right side uses Flutter 3.32.0.(The FPS difference may not be very obvious in the video because the recording frame rate is low. However, the FPS counter is visible in the video, and you can also run the code yourself to see the problem.)flutter_frame_rate_issue_20250909.mp4
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[√] Flutter (Channel stable, 3.35.3, on Microsoft Windows [版本 10.0.26100.4946], locale zh-CN) [293ms]
• Flutter version 3.35.3 on channel stable at C:\Users\74218\fvm\versions\stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a402d9a437 (6 days ago), 2025-09-03 14:54:31 -0700
• Engine revision ddf47dd3ff
• Dart version 3.9.2
• DevTools version 2.48.0
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations,
enable-lldb-debugging
[√] Windows Version (11 专业版 64-bit, 24H2, 2009) [2.3s]
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [4.8s]
• Android SDK at D:\software\Android\Sdk
• Emulator version 34.2.16.0 (build_id 12038310) (CL:N/A)
• Platform android-36, build-tools 35.0.0
• ANDROID_HOME = D:\software\Android\Sdk
• Java binary at: C:\Program Files\Java\jdk-19\bin\java
This JDK is specified in your Flutter configuration.
To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
• Java version Java(TM) SE Runtime Environment (build 19.0.2+7-44)
• All Android licenses accepted.
[√] Chrome - develop for the web [77ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.1) [75ms]
• Visual Studio at D:\software\vs2022
• Visual Studio Community 2022 version 17.10.34928.147
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2022.1) [10ms]
• 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 11.0.15+0-b2043.56-9505619)
[√] VS Code (version 1.103.2) [8ms]
• VS Code at C:\Users\74218\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.118.0
[√] Connected device (3 available) [223ms]
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.26100.4946]
• Chrome (web) • chrome • web-javascript • Google Chrome 140.0.7339.80
• Edge (web) • edge • web-javascript • Microsoft Edge 139.0.3405.125
[!] Network resources [361ms]
X A cryptographic error occurred while checking "https://github.com/": Connection terminated during handshake
You may be experiencing a man-in-the-middle attack, your network may be compromised, or you may have malware installed on your computer.
! Doctor found issues in 1 category.Predidit, JankLai, Taormina, AlexNik4, xiaobaimc and 1 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)platform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-windowsOwned by the Windows platform teamOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform teamTriaged by the Windows platform team