Skip to content

[regression/8.0.0] Shadow performance has dropped precipitously in Windows, rendering previously in .NET 7 easily at 30+ FPS (frames per second), now as low as 1 FPS #18205

@jonmdev

Description

@jonmdev

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:

#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):
resize lag android 1 resize lag android 2resize lag android 3

Bonus Bug
You can also see the abnormal Windows Shadow warping bug as reported here: #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:
CURRENT FPS 32.4485690181063
CURRENT FPS 35.1741118536757
CURRENT FPS 32.86338690065398
CURRENT FPS 33.1394674487581
CURRENT FPS 39.007493339470514
CURRENT FPS 31.42243058785083
CURRENT FPS 31.075588260885777
CURRENT FPS 31.609758564664084
CURRENT FPS 31.35562927612394
CURRENT FPS 31.381015740717494
CURRENT FPS 31.541562316664667
CURRENT FPS 31.98546580433851
CURRENT FPS 65.66678048908618
CURRENT FPS 31.139842806073514
CURRENT FPS 31.82898920678976
CURRENT FPS 31.84469976817059
CURRENT FPS 31.28627252220543
  1. In .NET 8:
CURRENT FPS 11.863339079143893
CURRENT FPS 22.52592170440134
CURRENT FPS 11.900440911335766
CURRENT FPS 19.266857537002
CURRENT FPS 10.084884472605923
CURRENT FPS 18.578899943334356
CURRENT FPS 8.672003996059441
CURRENT FPS 9.841609142461229
CURRENT FPS 8.343080832772957
CURRENT FPS 11.797196750108238
CURRENT FPS 6.354701653112088
CURRENT FPS 7.672418423011117
CURRENT FPS 7.557830630527136
CURRENT FPS 6.165786911637491
CURRENT FPS 7.184548048820441
CURRENT FPS 6.844908072884581
CURRENT FPS 6.426603051865257
CURRENT FPS 5.050762690420067
CURRENT FPS 6.028639655547645
CURRENT FPS 5.549574347647535
CURRENT FPS 5.116076092422937
CURRENT FPS 1.5638194726800738

Metadata

Metadata

Assignees

Labels

area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingi/regressionThis issue described a confirmed regression on a currently supported versionperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)platform/windowst/bugSomething isn't working

Type

No type

Projects

Status

Todo

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions