microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.36k stars 678 forks source link

Low frame rate #7373

Closed heckerpowered closed 8 months ago

heckerpowered commented 2 years ago

Describe the bug

This problem is extremely obvious on high frame rate monitors, not only my project, but also the WinUi3 project example (WinUI 3 Gallery) has this problem, the animation is not smooth and lagging, while WinUi2 does not have this problem, so I think it is a bug.

Steps to reproduce the bug

No steps,any animation is lagging and the frame rate is very low.

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.1.2

Windows app type

Device form factor

Desktop

Windows version

Windows 10 (21H2): Build 19044

Additional context

No response

marb2000 commented 2 years ago

Thanks, @heckerpowered. We're working to fix this scenario in WInAppSDK 1.2 timeframe. Although we can't commit it yet.

(@krschau, this is our internal AzDevOps feature request https://task.ms/39831498)

YorkFieldX commented 2 years ago

Can confirm the issue is very noticeable by comparing identical UWP Template and WinUI3 Template apps side by side on 120hz touchscreen display. While UWP is very smooth as expected, WinUI 3 app appears to be dropping frames on scrolling and any other animations. Hopefully there's a fix soon

gabbybilka commented 1 year ago

:tada:Microsoft.WindowsAppSDK.1.2.221109.1 has been released which fixes this issue.

Handy links:

cc: @bpulliam

lhak commented 1 year ago

This issue is still present in 1.2 even at 60Hz frame rate. Just compare the WinUI2 / WinUI3 gallery when scrolling in the "All controls" section.

ygorcortes commented 1 year ago

It isn't fixed on my end either... If I put both the WinUI 2 Gallery and the WinUI 3 Gallery side by side on my 144 hz display and start scrolling on each of them I can clearly see that the frame rate on the WinUI 3 Gallery is severely limited.

Void48 commented 1 year ago

This still hasn't been fixed? @gabbybilka https://user-images.githubusercontent.com/85196642/211982479-27ab317e-121b-4c24-8b15-e87b52782535.mp4

Nevodev commented 1 year ago

This bug is still not fixed.

EugenM88 commented 1 year ago

Hello, i would like to know a status update for this issue, my WinUI3 App also is lower fps than normal on my 144hz monitor. If i set it to 60hz its as smooth as 60fps, if i set my monitor to 144hz then the app instead of refreshing at 144fps its doesnt even reach 60fps anymore making any animation ugly and jittery.

When do you have plans to fix this specific issue? Thank you very much in advance!

EugenM88 commented 1 year ago

UPDATE: I have found where the bug is, this happens in applications wherever i use the mainwindow.dispatcherqueue, example: mainwindow.DispatcherQueue.TryEnqueue(() => { //some UI binding changes and other movements and animations updated right here });

bpulliam commented 1 year ago

There is a fix for frame rate issues on high refresh monitors in 1.3. Please give that build a try.

EugenM88 commented 1 year ago

There is a fix for frame rate issues on high refresh monitors in 1.3. Please give that build a try.

I was testing with 1.3 latest preview build, problem still remains, at 144hz the app responsiveness semms jittery while at 60hz it's silky smooth

beeradmoore commented 1 year ago

@gabbybilka , can we get this issue re-opened as it still appears to be broken.

gabbybilka commented 1 year ago

@bpulliam can you take a look?

ghostidentity commented 1 year ago

Seems like webview has no problem. https://mtagab-my.sharepoint.com/:v:/g/personal/admin_mtagab_app/EaPff7mNldNLpuJ35lvLTU4BzwyOdPryyoDB8WrK5yWGjw?e=eWaxKG

SnowSquire commented 1 year ago

This issue still exists

https://github.com/microsoft/microsoft-ui-xaml/assets/40239844/bab84963-3894-4f28-9624-c05dfd1f09b6

the source video is at 180fps, and when view on a 180hz monitor you can easily see how much more jittery winui 3 is

Void48 commented 1 year ago

This issue still exists

2023-09-30.14-20-30.mp4 the source video is at 180fps, and when view on a 180hz monitor you can easily see how much more jittery winui 3 is

Yeah, this issue still hasn't been fixed. It should be re-opened

ChewWorker commented 1 year ago

@SnowSquire / @Void48 can you confirm the version of WinAppSDK you are using, or see if it reproes on 1.4? Thanks!

Fefedu973 commented 1 year ago

same issue

Fefedu973 commented 1 year ago

NEED REOPEN

yaira2 commented 1 year ago

@bpulliam this appears to still be an issue.

pritster5 commented 1 year ago

Definitely still an issue. I have a 144hz monitor and the fps visibly runs at 60 fps max in any animation inside a WinUI app.

ChewWorker commented 11 months ago

@pritster5 @yaira2 @Fefedu973 can you confirm what version of WinAppSDK you are using?

Thanks!

yaira2 commented 11 months ago

WinAppSdk 1.4

EugenM88 commented 11 months ago

The very low fps issue has been fixed for me after upgrading my project to .net 6, .net 8 also works just fine.

However, there is still a fatal flaw with timers, i cannot for the life of me understand why a timer cannot go below a certain ammount of miliseconds... even if you set said timer lower, it will still take alot of time for it to start and stop, certainly alot longer than for example 3ms, dispatcher.tryenqueue might also have this issue. For performance applications this is unacceptable behavior.

Forgot to mention, im using windows app sdk 1.4.231115000, .net8, visual studio community 2022

Best Regards!

bpulliam commented 8 months ago

Looking at the history, there are multiple issues on multiple controls all pulled into this one issue. Many fixes have gone in already. If you have an issue with low frame rate, please open a new issue with your exact scenario, including control and WinAppSDK version. Thanks!