andy-5 / wslgit

Use Git installed in Bash on Windows/Windows Subsystem for Linux (WSL) from Windows and Visual Studio Code (VSCode)
MIT License
1.18k stars 59 forks source link

What kind of performance can I expect with Fork? #112

Closed brechtm closed 3 years ago

brechtm commented 3 years ago

Hi! I recently started experimenting with WSL2, coming from a native Ubuntu install. Thanks for building this bridge which allows me to use Fork!

It was a bit of adventure in getting Fork to work with wslgit, including having to set up ssh-agent and adjusting the FORKGITINSTANCE/GIT_INSTALL_ROOT environment variables which were set up by scoop. But now things seem to be set up correctly, and Fork works .... more or less. Here are the issues I encountered so far:

My git checkout resides on the virtual ext4 partition.

I'm wondering whether other wslgit+Fork users are experiencing these same issues.

carlolars commented 3 years ago

I run Fork+wslgit and yes it is slower than using native git, but its in the hundreds of milliseconds range, not seconds... Accessing files inside the WSL2 filesystem is faster than accessing files in the Windows filesystem, because of how WSL2 works, so nowadays I actually have most of my repositories in the WSL2 filesystem, it works fine even for most windows applications that can access the files using \\wsl$\.

There should not be any difference in speed when doing git-things using wslgit from PowerShell vs Fork on the same repository. And interactive rebase should work (works for me 😉 ).

adjusting the FORKGITINSTANCE/GIT_INSTALL_ROOT environment variables

What do you mean by this? All I did for it to work was to run the install.bat script in wslgit and then select a custom git instance in Fork as described in the README.md#usage-in-fork. And of course the ssh-keys/ssh-agent must be setup so that ssh inside WSL2 can access them.

brechtm commented 3 years ago

I run Fork+wslgit and yes it is slower than using native git, but its in the hundreds of milliseconds range, not seconds...

Thanks. I already suspected this must not have been normal. Checking fork.log under %LocalAppData%\Fork\logs, I noticed some warnings about unsupported arguments to git. Since I'm running Ubuntu 18.04 in WSL, the included git version doesn't support all features Fork requires. After upgrading to the latest git from the git-core PPA, my issues are fixed!

adjusting the FORKGITINSTANCE/GIT_INSTALL_ROOT environment variables

What do you mean by this? All I did for it to work was to run the install.bat script in wslgit and then select a custom git instance in Fork as described in the README.md#usage-in-fork. And of course the ssh-keys/ssh-agent must be setup so that ssh inside WSL2 can access them.

I installed Fork and wslgit through Scoop, which appareantly sets up some environment variables.