-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
.NET MAUI RC1 - CollectionView extremely slow #6317
Comments
It will probably work fine if you remove outer VerticalStackLayout. |
I've tried it but the problem still occurs. I would bet more that it is a problem with the recycling of CollectionView elements since the more items the ItemSource has and the more controls the DataTemplate has the slower the startup is because it probably proceeds to render all the controls of all the items of the CollectionView. |
Ok, I had a similar issue, but caused by the stack layout - it allows collectionView to grow infinitely, and therefore render all the items. Probably this one is different though, if it didn't help for you. |
Btw, you don't need an outer ScrollLayout either, CollectionView is already scrollable. |
As far as I see something similar has happened to me, since removing the ScrollView works correctly, probably what you said is that with the ScrollView allowed the CollectionView to grow infinitely until all its elements are rendered. This doesn't seem very appropriate, does it make sense for the CollectionView to grow infinitely when it is inside a ScrollView, can this thread be closed, or is it a bug? |
I think the important thing is here is that it works well in Forms. Then it should also work in .NET MAUI as far as I'm concerned :) |
Additional note: The CollectionView only grows infinitely when it's inside a ScrollView or VerticalStackLayout. With the rest of the Layouts it does not happen. |
I try https://github.com/nacompllo/MauiCollectionView on android emulator. It takes about 1 minute to initialize. |
Hello, I was looking what was I missing because the same code run in a blink of an eye on Xamarin Forms but on MAUI.... And don't even try to scroll on a ListView/CollectionView of more than 100 items : you definitively see the caching strategy in action : it freezes and jerks each time a new line appears on screen... |
ouh i hope there is coming a fix soon. ListView and CollectionView is so incredible slowly. For tests i run my Views only in a Grid without anything around, use only "10" items and have just the same issue as the Thread Owner. Cant understand why this isnt fixed right now. |
Do you have an ETA on this issue? I'm struggling to use my app especially on low spec devices due to this issue. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
I am having the same issue with 1k items it is taking well over 10 minutes to load on an emulator and my datatemplate is simple the collectionview is housed in a MAUI toolkit Popup here is what the xaml would look like the contentView is a seperate file that is shared between a contacts page and a new message popup where the issue occurs.
If i do not house this collectionview in a popup page then it renders quickly |
Huh, seriously? |
how do you optimize? |
ScrollView? but there are no problems with 2 displacements? |
I use DevExpress for CollectionView and other to make apps with .net maui. To see this, you can first download this test collection maui project by link: https://github.com/Kalyxt/Test_CollectionView, than you have to run it on your android phone, and you can see the collection view has large lags. To solve this problem, i had used devexpress collection view, and after that the collectionview works without any lags or bugs.
than xaml with devexpress collection view:
P.S. I can't belive that the developers of DevExpress could make collection view smooth scrolling, without any lags, but the developers of the Microsoft, couldn't do that. https://github.com/DevExpress-Examples/maui-demo-app It is the devexpress maui sample, where they have used a lot of collectionviews, data grid, charts, and all of them work great, i just can't believe how? I'm sorry for my English Please, if anyone can, then let the developers of microsoft know, why DevExpress CollectionViews works great, without any lags, but the standard collection view not, why couldn't microsoft devleopers do the same? |
Please try to use DevExpress, and you'll see how collectionview works great, there are no any lags, I tried to use DevExpress CollectionView and DataGrid, both of them works very well |
Please try to use DevExpress Collection Views, they work great, there are no any lags, bugs, |
does this layout work fine in DevExpress? |
It has to work with devexpress, any data collection works with devexpress without lags You can see it: Screenrecorder-2023-01-16-20-58-12-368.mp4I made this project with devexpress, where i extract data for collection view from two apis, and devexpress collection view shows it without lags |
DevExpress doesn't support windows as a target, and if i recall there is some features missing. I recall my show stopper was DevExpress didn't support data changes to observable collections, and the solution of using BindingList was not feasible with my application. |
It is the devexpress sample made with.net maui Screenrecorder-2023-01-16-21-23-09-243.mp4You can clone it from: |
Yes, devexpress doesn't support windows, only ios and android, but is enough for me. But, I haven't delved into the development yet, so i cant say what else supports and not by devexpress, i just have seen how their library supports large datas for collection view very well |
CollectionView with simple layout is not slow, try my repository layout. |
I have tried your project, so you made project scrolling both vertically and horizontally. I can't say, for sure, but I've seen the same devexpress project, wich has vertical and horizontal scrolls, and it scrolls both vertically and horizontally very well. I hope, it will help you. It is that project, and scrolling works good: Screenrecorder-2023-01-18-11-39-13-893.mp4 |
@jonathanpeppers everything fixed looks good, but what about #12130? |
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
The text was updated successfully, but these errors were encountered: