Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collectionview WinUI recycling item count calculation problem #20206

Open
enkaradag opened this issue Jan 28, 2024 · 5 comments
Open

Collectionview WinUI recycling item count calculation problem #20206

enkaradag opened this issue Jan 28, 2024 · 5 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Milestone

Comments

@enkaradag
Copy link

enkaradag commented Jan 28, 2024

Description

Hi again,

For WinUI;

In .NET MAUI version 8.0.6 (last release), CollectionView was creating extremely high count of recycle items (creating 350 400 items for a 1000 set tough 15-20 was enough for its vertical size) It was continiously creating new recycle items while scrolling. So it was flickering and app was becoming unresponsive.

It is fixed here #20079

Now testing 8.0.7-preview.9929

CV works so much better now. But it still creates 5x more recycle items for rows. For below capture; CV needs 17 recycle items but it is creating 84 rows. When collectionview size is changed or recycle items vertical size is changed CV always creates 5x more than required recycle items. This makes whole app unresponsive for afew seconds. If a complex itemtemplate is defined that lasts longer.

It's not creating more recyle items while scrolling (just 1 or 2 sometimes), so scrolling performance is good comparing to 8.0.6

I tested CV for android, ios and maccatalyst. For those it creates just enough count of recycle items.

bandicam.2024-01-28.15-10-16-493.mp4

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/enkaradag/collectionview_flicker_test2

Version with bug

Nightly / CI build (Please specify exact version)

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@enkaradag enkaradag added the t/bug Something isn't working label Jan 28, 2024
@jsuarezruiz jsuarezruiz added platform/windows 🪟 legacy-area-perf Startup / Runtime performance area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Jan 29, 2024
@PureWeen
Copy link
Member

@Foda thoughts?

@Foda
Copy link
Member

Foda commented Jan 30, 2024

@Foda thoughts?

Yup -- by default WinUI caches 4x the viewport size. We could lower this. The cache length increasing when resized is normal, but not by another 4x amount so we should investigate.

@enkaradag
Copy link
Author

This is a useful info.

So, is it somehow possible to set ItemsStackPanel.CacheLength value in an maui project using a renderer?

Drawing the viewport lasts for milliseconds but app stays unresponsive for afew seconds more. This looks bad for a modern ui

@PureWeen PureWeen added this to the Backlog milestone Jan 30, 2024
@ghost
Copy link

ghost commented Jan 30, 2024

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@samhouts samhouts added the potential-regression This issue described a possible regression on a currently supported version., verification pending label Jan 31, 2024
@PureWeen PureWeen removed the potential-regression This issue described a possible regression on a currently supported version., verification pending label Feb 22, 2024
@samhouts samhouts added the potential-regression This issue described a possible regression on a currently supported version., verification pending label Feb 27, 2024
@Eilon Eilon added t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) and removed legacy-area-perf Startup / Runtime performance labels May 10, 2024
@kevinxufei kevinxufei added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels Aug 20, 2024
@kevinxufei
Copy link

kevinxufei commented Aug 20, 2024

This issue has been verified using  Visual Studio 17.11.0 (8.0.80 & 8.0.6 & 8.0.3 & 8.0.0-rc.1.9171) & 17.11.0 (7.0.101). Can repro on Windows platform.

  • 8.0.6/8.0.7/8.0.20/8.0.40/8.0.80: results consistent with users to record the screen
  • 8.0.3&7.0.101: output window shows the CreatedGridCount:17, then the number increases to 500+ and an exception occurs
    q11
  • **8.0.0-rc.1.9171:**output window displays CreatedGridCount:57
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Projects
None yet
Development

No branches or pull requests

7 participants