-
Notifications
You must be signed in to change notification settings - Fork 1.9k
.NET MAUI RC1 - CollectionView extremely slow #6317
Description
Description
Doing some tests with the CollectionView I have realized that the control is extremely slow in .NET Maui, I have added a DataTemplate with several elements to simulate a scenario as close to reality (production environment) and I have realized that something is not It is working well since the more items the ObservableCollection has linked to the ItemsSource and the more items the CollectionView has to render, the slower the application starts, the only thing that occurs to me is that the CollectionView recycling system is not working correctly and render all the CollectionView items at the same time, I have created an identical repository in Xamarin.Forms with 9999 items in the CollectionView and everything works fast and well, however in .NET Maui the same case but only with 300 items takes 2:20 minutes in start the app.
When you go to do the tests, all you have to do is go to the MainPageViewModel class and in the constructor there is a loop that is in charge of initializing the ObservableCollection linked to the CollectionView, by default it is configured in 300 elements, which more or less will do that the app takes about 2:20 seconds to start completely, even when it starts after that time there is a little lag if you try to scroll in the CollectionView until a few seconds pass and the performance stabilizes. I recommend lowering that number to 50 or 100 for faster testing in .NET Maui. In the Xamarin.Forms repository it is set to 9999 items and the performance is perfect and fast, probably because the Xamarin.Forms recycling system works fine.
Loop image:
I leave the 2 GitHub repositories in case you need to do tests:
-
.Net Maui:
https://github.com/nacompllo/MauiCollectionView -
Xamarin.Forms:
https://github.com/nacompllo/XamarinCollectionView
Steps to Reproduce
Download the attached repository and follow the instructions detailed above.
Version with bug
Release Candidate 1 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
Android 10
Did you find any workaround?
No response
Relevant log output
No response
