Every call to add causes the UI to redraw. This is one of the most common performance hits I see with customer apps using MAUI/XF. ObservableCollections are really meant for "data in motion" (ie. Bluetooth Scan, as data comes in, it pushes on to the list). The bigger the payload of data becomes, the slower the call becomes.
In this case, you are pulling data from a service and pushing onto the observablecollection. My suggestion, since this data is not in motion, is to simply make [ObservableProperty] IList newsFeeds; and push the await right on to that. Less code, no perf hit.
Happy to submit a PR for this one, but I thought you may want to verify this for yourself.
MauiWorkshop/src/MyNewsReader/ViewModels/NewsFeedListViewModel.cs
Line 52 in 155283e
Every call to add causes the UI to redraw. This is one of the most common performance hits I see with customer apps using MAUI/XF. ObservableCollections are really meant for "data in motion" (ie. Bluetooth Scan, as data comes in, it pushes on to the list). The bigger the payload of data becomes, the slower the call becomes.
In this case, you are pulling data from a service and pushing onto the observablecollection. My suggestion, since this data is not in motion, is to simply make [ObservableProperty] IList newsFeeds; and push the await right on to that. Less code, no perf hit.
Happy to submit a PR for this one, but I thought you may want to verify this for yourself.