-
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
CollectionView - slow scrolling, laggy performance #8012
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I had the same problem in a Xamarin Forms app and these tips helped me get better performance: Maybe you can try https://github.com/roubachof/Sharpnado.CollectionView I know the MAUI team is doing a great job, but I think the |
This comment was marked as off-topic.
This comment was marked as off-topic.
I enabled the framerate under the developer options, upped to 10,000 rows, but I still get a good framerate with a Pixel 5: It sometimes says 90, but this was using a I'll get |
It is indeed noticeably better with Buidld-in scanner PDA - Not great not terrible recording_20220614_035847.mp4Lenovo TAB M10 FHD Plus 4GB - Laggy recording_20220614_040357.mp4Redmi Note 9 - Quite good recording_20220614_042117.mp4
|
CollectionView is a key element in any application. The fact that even with the release of MAUI CollectionView still works badly literally forces us to discard MAUI in favor of Flutter. |
@Kalyxt are you able to get the FPS on the screen for the slower devices? For hot reload support, MAUI apps use the intepreter by default in |
I couldn't find it under developer options on these devices so I downloaded FPS counter. It shows 60 FPS while scrolling even when it isn't smooth. We could go to more complex lists with images and more elements in each item and it will definitely be much worse. What is really bottleneck here, when I can scroll in settings like this: recording_20220615_091319.mp4And this is our sample on the same device: recording_20220615_090354.mp4 |
Sorry for OT but is there anyone who tried to use MAUI Blazor with grid (additionaly with virtualization) to see what is performance comparing to ColletionView? Thanks. |
Hi, any update on this? |
So these all would help this issue:
These all improve the general performance of putting views on the screen. The problem with this issue, is I don't think we have an accurate way to actual measure the problem here or at what point it will be fixed. How much faster does it need to be, to be "fixed"? I've heard the latest "dolphin" release of Android Studio has a profiler that can detect "jank" while scrolling. I need to use that and see if that shows anything. I just haven't gotten to it yet. |
How much faster does it need to be, to be "fixed"? First of all you should get few low end devices (for example - Lenovo TAB M10 FHD Plus - 180€), to be able to experience it. Pixel 5 or even budget phones from Xiaomi is not suitable for this. |
@Kalyxt have you tried dotnet/maui builds from I think the tradeoff here is the market share of these low-end devices, and is the goal for MAUI to run 100% perfect on them? If we wait some period of time, does the usage of these slower devices go away? I'm not person to make the decision if that is a goal for MAUI -- but I definitely want to improve performance where we can. Thanks! |
Its about performance, you just doesn't see it on powerful device. Why does android menu feel smooth and MAUI list with two labels not ? If its not optimized right, you might see smooth scrolling on flagship, but it takes more resources than it should. Is this right ? Btw, I tried @jfversluis CollectionView with monkeys and its running pretty good even on Lenovo TAB. recording_20220621_071451.mp4 |
I tried the sample above, with 10,000 rows in Android Studio Dolphin, following: https://developer.android.com/studio/profile/jank-detection The only change you need is to add in your
Unfortunately, my device shows 0 "Janky frames", and a max of ~9% CPU usage while scrolling: Next, I'll try a Google Pixel 2 XL, which might be the worst device I have. Are you able to do this on your device? Supposedly we can see dropped frames in this "Janky frames" menu, and you can click and see what method caused it? Unsure how this will display for a MAUI app until we see it. |
Ok my Pixel 2 is on Android 11 (latest update available for it), and the above tooling only works on devices running Android 12... |
I found out that If I enclose entire
With frame recording_20220622_011608.mp4recording_20220622_011526.mp4Without frame recording_20220622_011915.mp4recording_20220622_011833.mp4 |
Context: dotnet#8012 Context: https://github.com/Kalyxt/Test_CollectionView We had some reports of poor `CollectionView` performance while scrolling on an older Android device. Reviewing `dotnet trace` output, I did find some issues similar to dotnet#8001: 317.42ms (1.1%) mono.android!Android.Views.View.get_Context() 1% of the time is spent in repeated calls to `View.Context` inside the `ItemContentView` class. Making a new overload for `ContextExtensions.FromPixel()`, I was able to remove all of these calls. This results in only a couple `View.Context` calls on startup now, much better: 1.30ms (0.01%) mono.android!Android.Views.View.get_Context() Using the "janky frames" metric from the latest profiler in Android Studio Dolphin: https://developer.android.com/studio/profile/jank-detection With my slowest Android 12+ device, a Pixel 4a, I could actually see a few "janky frames" while scrolling the sample. With these changes in place, I only see 1 "janky frame" now. I also compared the before and after with the visual GPU profiler: https://developer.android.com/topic/performance/rendering/inspect-gpu-rendering It appears at a glance that these changes are better. I am unsure at what point the performance will be good enough to close dotnet#8012, but this helps!
@Kalyxt would you be able to test this com.companyname.test_collectionview-Signed.apk.zip This has the changes in dotnet/maui/main + #8243. This is built for |
This was probably closed on accident when a PR was merged. |
I made new app with different name so I could switch between apps without uninstalling the previous one. Its hard to tell, which one is better for me. I used my co-worker for a test, I gave him your version of application to test scrolling then the original. He picked your version as better. Slow scrolling is good on both, problem is when I scroll fast, it could be better. I appreciate your help with this issue, I think its time to move on. |
Personally, I don't think an issue like this should be weighed up against market share of low spec devices (deciding to drop support for older versions of Android? That is a perfect thing to weigh against market share). The issue should be Maui being benchmarked against other apps/frameworks. How do other apps/frameworks perform on a wide variety of devices? It sounds like there are a few excited PRs that do fix some of the performance issues. I don't know if it has been benchmarked, but maybe that will have benefits in Debug/Hot Reload mode scrolling performance too which may benefit higher spec devices? :) Another good reason to avoid looking at it from a market share POV. |
We have not stopped working on performance, if you want to see the progress for MAUI in .NET 7 you can see it here: |
Description
I have CollectionView with 200 items with 2 labels in each item, but scrolling performance is unacceptable.
Device - Lenovo TAB M10 FHD Plus 4GB – 128 GB Iron
With better hardware its slightly better, but not everyone has last gen CPU especially in devices with build-in barcode scanner.
recording_20220614_103041.mp4
recording_20220614_102654.mp4
@jonathanpeppers
Steps to Reproduce
Sample project
https://github.com/Kalyxt/Test_CollectionView.git
Version with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
All versions of android
Did you find any workaround?
Latest gen CPU
Relevant log output
No response
The text was updated successfully, but these errors were encountered: