-
Notifications
You must be signed in to change notification settings - Fork 577
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
Speed up checkout by fetching minimal data from remote and lazily loading it later #612
Comments
The change is even more significant for larger repos, 1733ms vs 6485ms for checkout out a branch on Microsoft/vscode:
Normal fetch and checkout:
Fetch remote branch only with no history:
|
We added some log data for checkout process. This morning I see a huge lag when checkout to a branch, the information is not enough yet, I'm going to add more later but it already shows some good info
44 seconds between the first and second log ;( |
Fetching the branch without history is fast and we can probably fetch the history in background later but the catch here is the diff view relies on If I understand correctly, the benefits of this is users get the code as soon as possible and then if they have some watch task running locally, they can the build result earlier. |
Just capturing our offline discussion here: I don't think it's blocked on #698, I just think the switching to review mode should be split into 2 steps, the first of which checks out the minimal set of code to unblock the user to view the code, run it, etc., the second fetches the history to enable diffs, etc. |
Fun fact, we can't fetch into current branch ;)
will throw error However we can do a |
@rebornix is all done for this on the extension side? Looking forward to testing it out 🙂 |
@Tyriar some work still needs to be done from extension side, will send out a pr. |
Fix #612. Separate checkout and fetch history
One of my big annoyances with the extension is how long it takes to checkout a branch, particularly on the first time checking this out. It's also even worse on Windows as git seems to be a little slower (due to FS?). This problem is also much worth with larger repos due to the size of the history, branch/tag count, etc.
I'm proposing that when a PR is checked out for the first time we fetch just the branch (
r branch
) and no history (--depth=1
), something like this:The history and rest of branches can then be lazily fetched later with this:
Based on my testing this should provide a very significant speed up:
Normal fetch and checkout:
Fetch remote branch only with no history:
The text was updated successfully, but these errors were encountered: