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

git commands are slow with many calls to git_config_get_virtualfilesystem => GetEnvironmentVariableW #450

Closed
1 task done
benwitman opened this issue Oct 15, 2021 · 2 comments · Fixed by #451
Closed
1 task done
Assignees

Comments

@benwitman
Copy link

benwitman commented Oct 15, 2021

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
X:\Office\src>git --version --build-options
git version 2.33.0.vfs.0.0
cpu: x86_64
built from commit: 24f9d5c95d3ab8fe65553b8d488e1b287eda8e42
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
X:\Office\src>cmd.exe /c ver
Microsoft Windows [Version 10.0.19043.1288]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
X:\Office\src>type "C:\Program Files\Git\etc\install-options.txt"
Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Core
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Scalar / sparse-checkout is being used.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

cmd

X:\Office\src>git config --unset core.virtualfilesystem
X:\Office\src>timethis git status
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:39:27 2021
On branch namespace/mybranch Your branch is up to date with 'origin/namespace/mybranch'.
You are in a sparse checkout with 8% of tracked files present.
nothing to commit, working tree clean
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:39:27 2021
TimeThis :      End Time :  Fri Oct 15 14:39:40 2021

TimeThis :  Elapsed Time :  00:00:13.498


X:\Office\src>git config --add core.virtualfilesystem ""
X:\Office\src>timethis git status
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:39:43 2021
On branch namespace/mybranch Your branch is up to date with 'origin/namespace/mybranch'.
You are in a sparse checkout with 8% of tracked files present.
nothing to commit, working tree clean
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:39:43 2021
TimeThis :      End Time :  Fri Oct 15 14:39:46 2021

TimeThis :  Elapsed Time :  00:00:02.831


X:\Office\src>git config --unset core.virtualfilesystem
X:\Office\src>timethis git status
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:39:59 2021
On branch namespace/mybranch Your branch is up to date with 'origin/namespace/mybranch'.
You are in a sparse checkout with 8% of tracked files present.
nothing to commit, working tree clean
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:39:59 2021
TimeThis :      End Time :  Fri Oct 15 14:40:13 2021

TimeThis :  Elapsed Time :  00:00:13.408


X:\Office\src>git config --add core.virtualfilesystem ""
X:\Office\src>timethis git status
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:40:22 2021
On branch namespace/mybranch Your branch is up to date with 'origin/namespace/mybranch'.
You are in a sparse checkout with 8% of tracked files present.
nothing to commit, working tree clean
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:40:22 2021
TimeThis :      End Time :  Fri Oct 15 14:40:25 2021

TimeThis :  Elapsed Time :  00:00:02.780


X:\Office\src>git config --unset core.virtualfilesystem
X:\Office\src>timethis git status
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:41:06 2021
On branch namespace/mybranch Your branch is up to date with 'origin/namespace/mybranch'.
You are in a sparse checkout with 8% of tracked files present.
nothing to commit, working tree clean
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:41:06 2021
TimeThis :      End Time :  Fri Oct 15 14:41:19 2021

TimeThis :  Elapsed Time :  00:00:13.370


X:\Office\src>git config --add core.virtualfilesystem ""
X:\Office\src>timethis git status
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:41:26 2021
On branch namespace/mybranch Your branch is up to date with 'origin/namespace/mybranch'.
You are in a sparse checkout with 8% of tracked files present.
nothing to commit, working tree clean
TimeThis :  Command Line :  git status 
TimeThis :    Start Time :  Fri Oct 15 14:41:26 2021
TimeThis :      End Time :  Fri Oct 15 14:41:28 2021

TimeThis :  Elapsed Time :  00:00:02.759
  • What did you expect to occur after running these commands?

The git status performance to be ~2-3 seconds

  • What actually happened instead?

The git status performance is around ~13 seconds

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Office: Bug

@derrickstolee
Copy link
Collaborator

Thanks. This will be fixed with #451 and available in the 2.34 release.

@derrickstolee derrickstolee self-assigned this Oct 17, 2021
derrickstolee added a commit that referenced this issue Oct 17, 2021
…once

Users are noticing slowdowns with things checking GIT_VIRTUALFILESYSTEM_TEST
environment multiple times. This is likely due to checking for the virtual
filesystem while engaging with the FS Monitor feature.

Use a `static` variable to avoid initializing these globals multiple times.

Resolves #450.
derrickstolee added a commit that referenced this issue Oct 19, 2021
This reverts commit f55843a.

We are disabling the sparse index by default so we can take the latest
changes from the vfs-2.33.0 branch and cut a new release that should help
users affected by #450 (slow commands due to getting an environment
variable).

This commit represents an approach that would include shipping the latest FS
Monitor feature in addition to other installer fixes.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee
Copy link
Collaborator

This should be fixed in v2.33.0.vfs.0.3. Please let me know if you have any issues with that release.

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 a pull request may close this issue.

2 participants