Skip to content
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

Show progress bar while loading registry #2617

Merged
merged 1 commit into from
Dec 26, 2018

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Dec 19, 2018

Problem

Refreshing the mod list in GUI involves two steps:

  1. Getting the new data from the server
  2. Updating the lists and filters

Step 2 can take several seconds. While it's happening, the window freezes, because the intensive processing is done on the GUI thread (whereas step 1 has a progress bar). The freeze also happens when switching instances and changing version compatibility.

Changes

Now while the mod list is loading, the processing takes place in a background thread, and the progress bar screen is shown with messages indicating which step we're on (helpful for identifying slow pieces!):

image

This keeps the UI responsive and assures the user that it hasn't crashed. When finished, the tab is hidden.

Side performance tweak

While implementing this, I found out that the slowest step is Registry.Available, with a typical run time of up to a few seconds (I thought it would be loading the data from the registry.json file).

Unrelated to the above changes, this function was always called at the end of a repo update, but that was just to generate an int return value that isn't even used most of the time. So now those functions return bool and just return true instead of calling Registry.Available, and calling code is updated to call Registry.Available when it's actually needed. This should slightly speed up refreshes in GUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement GUI Issues affecting the interactive GUI Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants