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
22.12k stars 1.73k forks source link

[Android] Performance issue with Horizontal ScrollView #22184

Open jsuarezruiz opened 5 months ago

jsuarezruiz commented 5 months ago

Description

When using a horizontal ScrollView with a layout, we have an infinite Layout loop dramatically impacting performance.

This is the behavior on Xamarin.Forms: sv-horizontal-xf

And this is .NET MAUI: sv-horizontal-maui

Steps to Reproduce

  1. Sync or download https://github.com/jsuarezruiz/netmaui-chat-app-challenge
  2. Launch the App on Android.
  3. Try to scroll the top horizontal list (just 10 items in the sample code, 100 in the gif but can see the problem in any case).

Link to public reproduction project repository

https://github.com/jsuarezruiz/netmaui-chat-app-challenge

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 14

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 5 months 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.

Adam-- commented 5 months ago

Hey @jsuarezruiz, how do you get the performance indicators shown in your gif in the description?

jsuarezruiz commented 5 months ago

Hey @jsuarezruiz, how do you get the performance indicators shown in your gif in the description?

From the Developer Settings, Profile HWUI rendering https://developer.android.com/topic/performance/rendering/inspect-gpu-rendering

BaY1251 commented 5 months ago

similar to #20684 ? Although there are differences in the problem descriptions, I believe these two problems are similar. You can check the CPU differences through commands "adb shell top"