Skip to content

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

Description

  • 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions