unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.89k stars 720 forks source link

[Perf] [Android][Skia] ListView re-layouted multiple times #12081

Open dr1rrb opened 1 year ago

dr1rrb commented 1 year ago

Current behavior

When running the sample ListView_Expandable_Item, on android, checking one of the CheckBox causes the ListView to be re-measured multiple times, driving all items to be detached and re-attached from their parent up to 23 times ...

Expected behavior

Size caching / limited scope invalidation should prevent any re-measure/layouting of the ListView itself.

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Xiaoy312 commented 1 year ago

the issue is reproducible on skia as well the VirtualizingPanelLayout::MeasureOverride get spammed for 250+ times for a simple LV with 5 items

it is worth noting that it only starts getting spammed when we mouse-over the LV area if the cursor was already over the LV area, before/while the LV loads, then this issue wont occur even if you mouse-exit and mouse-"re"enter again which could indicate the problem is pointer and/or visual-state related

the amount of calls doesnt seem to scale with the complexity of the ItemTemplate used

ramezgerges commented 1 year ago

Is there a repro for this? I've tried and it doesn't seem to reproduce on my end (tried skia).