Open jonmdev opened 1 year ago
After debugging a little bit, we have indeed gone from an average of 182fps (for 30s), to 0.65fps, a drastic drop in performance. This is a regression, introduced at https://github.com/dotnet/maui/commit/3f417755ea47b82b7daec807e723ea2bf6fa597d#diff-61362aac9bd0efecc45f0aec6d7c8c6d55758504c003e1109e7b4da0940b bae8
Removing line 287 from WrapperView: dropShadow.Mask = await Child.GetAlphaMaskAsync();
restore the previous performance.
Working on a fix for Issue 16094 but without impacting performance.
Glad to hear it was a simple fix @jsuarezruiz ! Since you have been looking at this, any thoughts about the similarly poor performance in Android with Shadow resizing?
It is equally crippling down to just 3-8 fps or so in Android (both .NET 7/8) even on strong devices that can handle high end 3D graphics and should certainly be able to draw some simple shadows.
https://github.com/dotnet/maui/issues/18202
Perhaps harder since it's broken in both versions so maybe less clear where the issue is coming from? Thanks for any thoughts.
When will the pull request that fixes this issue will be pulled into the main branch? Is there a service/maitenance milestone that has planned pulling this request?
Description
Previously in .NET 7 Windows Shadow rendering speed was normal allowing normal layout speed and project frame rates of 30+ FPS during even debugging.
Now in .NET 8 the speed has dropped by over an order of magnitude and we are getting FPS rates of 1-20 for the same projects.
I do not know if this is related to the same performance problems happening with Android in both .NET 7 & .NET 8 as posted here:
https://github.com/dotnet/maui/issues/18202
However, the fact that Windows did not show this problem in .NET 7 but now shows it in .NET 8 clearly indicates this is some sort of Maui implementation problem and not a weakness of any inherent platform.
It also suggests that if it worked fine in .NET 7 in Windows, then got broken in .NET 8, this can be reversed and likely fixed in Android too.
My Windows desktop has a very strong consumer processor and at least a moderately strong graphics card, and yet it drops down to 1 FPS drawing this simple project. This makes no sense certainly. Same as my advanced 120 Hz Samsung device only rendering a simple project at 6 FPS. Neither makes sense.
BUG PROJECT This uses the same project as the linked report above. It just oscillates some Borders on screen in terms of their heights and debugs out the frame rate that it renders at. All custom code is in App.xaml.cs. All else is default Maui project.
This is what it looks like in Android (same in Windows):
Bonus Bug You can also see the abnormal Windows Shadow warping bug as reported here: https://github.com/dotnet/maui/issues/18172
The Shadow is not drawn correctly in .NET 7 or .NET 8 Windows as you can clearly see when playing this project. .NET 7 & .NET 8 have slightly different behavior as you can watch in this repro project but they are both very messed up.
Steps to Reproduce
Open project and press play. Look at debug output frame rate. Run in .NET 7 and see it is reasonable. Run in .NET 8 and see it is quite poor.
Link to public reproduction project repository
https://github.com/jonmdev/Resize-Lag-Bug
Version with bug
7.0.96
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.96
Affected platforms
Windows
Affected platform versions
Windows 10
Did you find any workaround?
None.
Relevant log output
1) In .NET 7:
2) In .NET 8: