-
Notifications
You must be signed in to change notification settings - Fork 60
Description
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:
| git | clone time |
|---|---|
| wsl2 | 0.580s |
| wslgit-wsl2 | 0.786s |
(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:
| git | clone time |
|---|---|
| win64 | 5.769s |
| wsl1 | 11.837s |
| wslgit-wsl1 | 11.800s |
| wsl2 | 63.448s |
| wslgit-wsl2 | 63.879s |
(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 and git.
| exclusion | clone time |
|---|---|
| - | 48.708s |
| Processes (busybox+git) | 11.689s |
| Folder | 12.981s |
| Folder + Processes | 11.577s |
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 new WSLGIT_DEFAULT_DIST variable by using the following PowerShell command:
$env:WSLGIT_DEFAULT_DIST="MyWSL1Dist"From a bash-shell in WSL1/WSL2 I used the time command and in PowerShell I used the Measure-Command to measure the time:
Measure-Command { wslgit clone vscode vscode-1 }time git clone vscode vscode-1Don't forget to delete
vscode-1before running again.