dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.72k forks source link

Slow Collectionview Rendering performance in Maui compared to Xamarin #24224

Open brentpbc opened 4 weeks ago

brentpbc commented 4 weeks ago

Description

I am currently migrating our existing LOB app that is on the iOS app store from Xamarin Forms to .Net Maui and I am noticing performance issues in the Maui version compared to the Xamarin version. This is most noticeable when testing on older slower devices such as the 2018 6gen iPad we have access to which is a good representation of the devices our customers would be using.

I have created an example repo https://github.com/brentpbc/maui-xam-testing.git that contains a Xamarin solution and a Maui solution, both have essentially the same code. In the test app there is a "CollectionView2 Page" button, in the Maui version after tapping the button there is a delay navigating to the "CollectionView2 Page" which is not present in the Xamarin version and then once the page is displayed the scroll stutters and doesn't match the performance of the Xamarin version. Both versions were built in Release mode when comparing. See below screen recordings for a comparison.

Xamarin solution: https://github.com/brentpbc/maui-xam-testing/tree/main/CollectionViewTesting1/CollectionViewTestAppXam Maui solution: https://github.com/brentpbc/maui-xam-testing/tree/main/CollectionViewTesting1/CollectionViewTestAppMAUI

MAUI ios Simulator iPad 6Gen Speedscope File: https://github.com/brentpbc/maui-xam-testing/blob/main/CollectionViewTesting1/Speedscope/iPad_6gen_sim_CollectionViewTestAppMAUI.speedscope.json

Xamarin Screen Recording: https://github.com/brentpbc/maui-xam-testing/raw/main/CollectionViewTesting1/ScreenRecordings/iPad_6gen_device_Xamarin.mp4

https://github.com/user-attachments/assets/b4b2ef6d-ef6b-4186-bd4d-304818df325e

Maui Screen Recording: https://github.com/brentpbc/maui-xam-testing/raw/main/CollectionViewTesting1/ScreenRecordings/iPad_6gen_device_Maui.mp4

https://github.com/user-attachments/assets/88cc3273-100d-4b54-a1fc-4b8b2cb29b35

Steps to Reproduce

  1. Clone repo
  2. Build Xamarin Version https://github.com/brentpbc/maui-xam-testing/tree/main/CollectionViewTesting1/CollectionViewTestAppXam in release
  3. Build Maui Version https://github.com/brentpbc/maui-xam-testing/tree/main/CollectionViewTesting1/CollectionViewTestAppMAUI in release
  4. Open the Xamarin app and tap "CollectionView 2 Page" button and scroll list
  5. Open the Maui app and tap "CollectionView 2 Page" button and scroll list and compare time to load page + scrolling performance to xamarin.

Link to public reproduction project repository

https://github.com/brentpbc/maui-xam-testing.git

Version with bug

8.0.80 SR8

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

github-actions[bot] commented 4 weeks ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Zhanglirong-Winnie commented 4 weeks ago

This issue has been verified using Visual Studio 17.11.0 Preview 7.0 (8.0.80 & 8.0.40 & 8.0.3 & 7.0.101). Can repro on iOS and Android platforms.