Skip to content

[Windows] app frame rate unstable since Flutter 3.35.0 #175135

Closed

Description

@JankLai

Steps to reproduce

  1. Run a simple Windows Flutter app on 3.35.0.

  2. Observe FPS without doing anything.

  3. 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.

Activity

  1. darshankawar commented on Sep 10, 2025

    @darshankawar
    Member

    @JankLai We verified on Windows 11 without monitor as we don't have high refresh rate external monitor and below is comparison between 3.32 and 3.35+:

    fps3.32.mp4
    fps3.35.mp4

    If you see, there isn't any difference between the frame rates. Since you are using external monitor I presume, the high refresh rate of it could be causing the reported behavior. The FPS in our case was limited to ~60. Can you check without external monitor to see if you still see reported behavior ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 10, 2025
  3. JankLai commented on Sep 10, 2025

    @JankLai
    Author

    @darshankawar Hi, thank you for checking this issue.

    I saw you tested on a 60Hz device. But my problem is happening on a high refresh rate monitor (165Hz).

    I think the problem is about how the app works on high refresh rate monitors. A solution can't be just using a 60Hz monitor, because many users have 144Hz or 165Hz monitors. (My personal guess is maybe the new Flutter version is now limiting the default FPS to around 60 on Windows to save power, and it only unlocks the full refresh rate when it detects user interaction.)

    My goal is to ensure the app performs consistently and smoothly on all modern displays, including those with high refresh rates. Could you please check this issue again, thinking about the FPS going up and down on a high refresh rate monitor? Thank you.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 10, 2025
  5. darshankawar commented on Sep 11, 2025

    @darshankawar
    Member

    Thanks for the update @JankLai. Please check this issue which has same discussion about refresh rate on windows as well, to see if it helps further in your case or not.

  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 11, 2025
  7. JankLai commented on Sep 11, 2025

    @JankLai
    Author

    @darshankawar Thank you for providing the link. I have checked it. But my app was working fine on Flutter 3.32.0. The frame rate issue started after I updated to version 3.35.0.

    This means it could be a new bug in the new version. I hope this information is helpful for you to find the issue.

  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 11, 2025
  9. darshankawar commented on Sep 11, 2025

    @darshankawar
    Member

    Thanks for the update. Keeping the issue open for team's tracking as we are unable to verify / replicate due to lack of high refresh external monitor.

  10. added
    platform-windowsBuilding on or for Windows specifically
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    team-windowsOwned by the Windows platform team
    and removed
    in triagePresently being triaged by the triage team
    on Sep 11, 2025
  11. 7 remaining items

  12. knopp commented on Sep 24, 2025

    @knopp
    Member

    I think this might be caused by SetTimer resolution which is rather coarse for compatibility reasons.

    @JankLai, does the problem persist when you call timeBeginPeriod(1) at the beginning on your application?

    https://learn.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod

  13. knopp commented on Sep 24, 2025

    @knopp
    Member

    I might be that timeBeginPeriod will not directly affect WM_TIMER resolution, in which case we'll need to use different mechanism to wake up the loop.

  14. JankLai commented on Sep 24, 2025

    @JankLai
    Author

    @knopp Hi, I just tested with timeBeginPeriod(1) (added in main.cpp before running the app), but unfortunately the issue still persists.

  15. knopp commented on Sep 25, 2025

    @knopp
    Member

    Yeah, I just tested it too, it unfortunately doesn't affect WM_TIMER granularity. We're going to need a bigger hammer than that.

  16. added 2 commits that reference this issue on Sep 29, 2025
    a68acd4
    83f8208
  17. added
    r: fixedIssue is closed as already fixed in a newer version
    on Oct 2, 2025
  18. github-actions commented on Oct 16, 2025

    @github-actions

    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.

  19. locked as resolved and limited conversation to collaborators on Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopc: performanceRelates to speed or footprint issues (see "perf:" labels)platform-windowsBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionteam-windowsOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions