ak2yny / OpenHeroSelectGUI

GUI for OpenHeroSelect based on MUAOpenHeroSelect by adamatti
GNU General Public License v3.0
4 stars 1 forks source link

Selecting MUA & XML2 tabs is delayed #10

Open ak2yny opened 1 year ago

ak2yny commented 1 year ago

Switching between pages, especially MUA & XML2 pages takes a moment (does it depend on the system?). Especially during debug?

We can add chache to pages (in xaml), like this:

    NavigationCacheMode="Required"

But adding this to the XML2 an MUA pages doesn't solve the issue. Adding it to the settings page creates a bug, where the settings won't update when the game was changed (opening settings isn't delayed much). Info is not delayed so adding a cache is not effective there.

It's possible that this issue is related to #8 as the affected pages use multiple ObservableCollections.

ak2yny commented 1 year ago

After fixing issue #8 this seems to be slightly improved. There still is a delay, however, and it seems like save and load as well as populating each list together are responsible. Save and load (including populating the selected list) is too big of a benefit to change, so this is not going to change in the foreseeable future.

A solution is to keep two separate selected lists for each game. It remains to be seen, if this really improves performance though. It's also a complicated task to filter the first time load (the roster should still be loaded when the GUI starts).

ak2yny commented 9 months ago

Adding this here, since it's related: The new Teams tab is also delayed. Parsing the XML element to the custom observable collection (max. 32 x 8 loops) seems to take a long time. I don't know how one would serialize an XML to a list normally and if this would be faster.

Update: After changing the code, where deserialization wouldn't happen when switching to the page, loading is still delayed.

ak2yny commented 9 months ago

Having separate lists doesn't seem to help for the teams, so I'm scratching that idea. The only remaining idea is cache (at this time). And cache disables initialization when opening a new tab, which is required in most/all cases (sometimes even prevents builds from completing successfully).

ak2yny commented 8 months ago

I made some tests, and even though reading and writing settings from files takes a little while, it's not what really seems to delay the loading. The observable properties are updated and ready at the time when I notice the site being delayed (on initialization). It seems like loading the UI is taking the most time. It may depend on the bindings or lists (tabs seem to load faster with empty lists), especially lists with a data template. I don't know if this can be improved.