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

Do not delay Dashboard start for invalid Git repos #10918

Merged

Conversation

gerhardol
Copy link
Member

There has been related issues before, that has been addressed somehow.
I saw this issue after adding some repos to WSL and an USB stick,
Dashboard would require about 1:30 to open.

This could be included in 4.1, but I do not want to delay the release.

Proposed changes

Add the repos to the lists without any I/O to check if the repo is invalid or not (to set the icon).
Perform the check if a repo has a valid Git dir async, together with branch name retrieval and set the invalid icon then instead.

Rendering of branch name failed if the item was rendered before the branch name was set.
This had a much higher probability to occur after the item creation was changed.

Menu item to remove invalid repos was only set from favorite repos, as _hasInvalidRepos was overwritten.

Test methodology

Manual.

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned gerhardol Apr 26, 2023
@RussKie
Copy link
Member

RussKie commented Apr 27, 2023

I observed a significant dashboard slowness, and I almost raised an issue for it at one point but I was unable to replicate the issue in debug builds. I've taken few memdumps, and looking at those I think your suggested fix may be right on target:
image

I'm going to take your change for a spin before I provide more feedback.

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀
Thank you

@RussKie RussKie added this to the 4.1 milestone Apr 27, 2023
@gerhardol
Copy link
Member Author

Then I will rebase this to 4.1 tonight.

Some notes I should have added to the description:

There may be ways to improve the detection time as well but this should be the big change. It should primarily affect the slow repos (start wsl?), Showing the status for other. (Wsl branch names are occasionally missing.)

We are probably creating two GitModule in the async code. Some Ms per repo added.

Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible, have not run

Add the repos to the lists without any I/O to check
if the repo is invalid or not (to set the icon).
Perform the check if a repo has a valid Git dir async,
together with branchname retrieval and set the invalid icon
then instead.

Rendering of branchname failed if the item was rendered before
the branchname was set.
This had a much higher probability to occur after the
item creation was changed.

Menu item to remove invalid repos was only set from
favorite repos, as _hasInvalidRepos was overwritten.
@gerhardol gerhardol changed the base branch from master to release/4.1 April 27, 2023 20:18
@gerhardol gerhardol force-pushed the feature/dashbord-invalid-repos branch from 76f14e6 to dd3bd96 Compare April 27, 2023 20:19
@gerhardol
Copy link
Member Author

There may be ways to improve the detection time as well but this should be the big change. It should primarily affect the slow repos (start wsl?), Showing the status for other. (Wsl branch names are occasionally missing.)

I do not find an obvious way to check the path for network including wsl any faster.

We are probably creating two GitModule in the async code. Some Ms per repo added.

No, this is fine, only one module.

@RussKie RussKie merged commit 7c3e2ea into gitextensions:release/4.1 Apr 27, 2023
3 checks passed
@gerhardol gerhardol deleted the feature/dashbord-invalid-repos branch April 28, 2023 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants