Skip to content

Collection Binding Improvement #1

@aritchie

Description

@aritchie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions