flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

[desktop_multi_window] Performance degradation with multiple windows – high raster time and low FPS

Open lukasz-lukasz-lukasz opened this issue 7 months ago • 2 comments

I’m experiencing significant performance degradation (low FPS / high raster time) when rendering multiple windows within the same Flutter process using the desktop_multi_window plugin on Windows.

Each window displays its own content with graphics and/or animations. As the number of open windows increases, overall performance drops substantially – even though system resources (CPU/GPU usage) remain well below 100%.

Interestingly, when launching the same number of windows as separate processes (i.e., multiple instances of the same app), performance remains smooth, suggesting that the issue only occurs when multiple windows are rendered within a single process.

I’ve tried optimizing the application code and rendering logic, which helps slightly, but does not resolve the core problem.

I understand that Flutter's multi-window support is still unofficial and experimental, but based on my tests, the performance issue seems to stem from Flutter's internal architecture rather than from this plugin directly. Nonetheless, I wanted to document the behavior here in case it helps identify workarounds or plugin-level improvements.

Steps to Reproduce

  • Clone the sample code: example code

  • Build and run the project

  • Open multiple windows via the plugin and monitor performance stats

Low FPS/ high raster time: https://github.com/user-attachments/assets/8aa5d05b-b987-4f61-99e0-9ea8bf5fb7fa

Stable FPS/ low raster time: https://github.com/user-attachments/assets/3c803c28-544e-4e50-918f-d300ef7bf868

Observed result: Low FPS / high raster time across all windows

Expected result: Performance should remain stable as long as system resources are not saturated

lukasz-lukasz-lukasz avatar May 06 '25 13:05 lukasz-lukasz-lukasz

I also reported it to the Flutter Team here: https://github.com/flutter/flutter/issues/168376

lukasz-lukasz-lukasz avatar May 06 '25 15:05 lukasz-lukasz-lukasz

whoa, thats a nice repro

nrbnlulu avatar Jun 09 '25 06:06 nrbnlulu