Efficient way to sync large ViewModel updates with UI?
Hi everyone,
I’m working with NoesisGUI and using MVVM, where my ViewModel receives frequent updates with fairly large data sets (for example, lists updated every frame or every few milliseconds). Right now, updating the bound properties causes noticeable UI hitches.
Is there a recommended pattern in NoesisGUI to efficiently sync large or frequent ViewModel updates with the UI without triggering full layout or redraw costs each time? For example, are there best practices around batching updates, using collections differently, or deferring notifications?
Thanks!
I’m working with NoesisGUI and using MVVM, where my ViewModel receives frequent updates with fairly large data sets (for example, lists updated every frame or every few milliseconds). Right now, updating the bound properties causes noticeable UI hitches.
Is there a recommended pattern in NoesisGUI to efficiently sync large or frequent ViewModel updates with the UI without triggering full layout or redraw costs each time? For example, are there best practices around batching updates, using collections differently, or deferring notifications?
Thanks!
No magic.Retro Bowl Just well-written code.
Re: Efficient way to sync large ViewModel updates with UI?
A big factor here is how the data is being updated.
How large are these updates, and what exactly changes each time? For example, are you clearing and repopulating entire lists every frame (which is generally not recommended), or are you updating only the items that actually change?
In our experience, most performance issues like this come from overly aggressive update strategies. triggering property or collection change notifications more often than necessary, especially for properties that affect layout.
Incremental updates (modifying existing items instead of rebuilding collections), minimizing INotifyPropertyChanged notifications, and avoiding layout-affecting changes on every tick usually make a big difference.
If you can share more details about your scenario, or ideally a small repro project, we can give more specific guidance.
There is also an important optimization coming in NoesisGUI 3.2.11 that will improve notification performance for ViewModels with a large number of properties.
How large are these updates, and what exactly changes each time? For example, are you clearing and repopulating entire lists every frame (which is generally not recommended), or are you updating only the items that actually change?
In our experience, most performance issues like this come from overly aggressive update strategies. triggering property or collection change notifications more often than necessary, especially for properties that affect layout.
Incremental updates (modifying existing items instead of rebuilding collections), minimizing INotifyPropertyChanged notifications, and avoiding layout-affecting changes on every tick usually make a big difference.
If you can share more details about your scenario, or ideally a small repro project, we can give more specific guidance.
There is also an important optimization coming in NoesisGUI 3.2.11 that will improve notification performance for ViewModels with a large number of properties.
Who is online
Users browsing this forum: No registered users and 8 guests