-
Notifications
You must be signed in to change notification settings - Fork 59
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
Performance Measurements #131
Comments
Thanks for sharing your results, very interesting. Didn't expect that native Git on Windows is ~10x slower than Git inside WSL2. And the difference between WSL1 and WSL2 accessing the Windows filesystem seems to be about 5x. So it looks like keeping everything inside WSL2 is ideal. And for accessing Windows filesystems, WSL1 (or native Windows Git) seems to be the way to go. |
Interesting. I too noticed Recently, there was a news of huge performance boost in 9p: https://lwn.net/Articles/918213/ |
Nobody noticed performances issues inside VSCode after installing There's a "Running 'File Create' participants" notification, could it be that VSCode calls git on each file creation ? |
@TBG-FR VSCode indeed calls git several times for each new file. You can see the exact commands, including timing information, in the "Output" pane in VSCode (select "Git" from the dropdown on the right). There are several factors that can cause performance issues (see benchmarks above):
The benchmarks above also show that the overhead of |
When I implemented #129 I did some simple performance measurements and I thought I'd share the results.
Test Results
WSL2 Filesystem
Clone from WSL2 to WSL2 filesystem:
(I also ran this test on my work laptop that is ~8 years newer than my private desktop and the measured times were 0.404s and 0.455s, so on modern hardware the wslgit overhead is even lower)
Windows Filesystem
Clone from Windows filesystem to Windows filesystem:
(Unfortunately I cannot disable the antivirus on my work-laptop so it is actually slower than my old desktop)
Anitvirus
The AV can have a huge impact on the git performance. On my desktop I use Microsoft Defender Antivirus where it is possible to exclude folders and processes. I ran this test using git from my WSL1 instance (Alpine Linux) and tried combinations of disabling then folder and the processes. The nice thing about WSL1 is that the processes are actually visible by Windows so it is possible to add WSL1 processes to the exclusion list, for Alpine Linux the processes to exclude are
busybox
andgit
.The results indicate that it is actually better to exclude the processes rather than the folder.
Test Method
I first cloned the microsoft/vscode repository to the local disk and then measured the time it took to clone from the local copy to a destination on the same filesystem (Win->Win, and WSL2->WSL2) using
wslgit
, git for windows (64-bit), and git inside WSL1 and WSL2.When running
wslgit
on the Windows filesystem the WSL-distro to use was selected using the newWSLGIT_DEFAULT_DIST
variable by using the following PowerShell command:From a bash-shell in WSL1/WSL2 I used the
time
command and in PowerShell I used theMeasure-Command
to measure the time:time git clone vscode vscode-1
The text was updated successfully, but these errors were encountered: