Git: Git commands have a 2-3 second delay before returning to the prompt

Created on 23 Feb 2017  路  27Comments  路  Source: git-for-windows/git

  • [x] 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?
$ git --version --build-options

**
git version 2.11.1.windows.1
built from commit: 1c1842bcba45569a84112ec64f72b08eb2d57c68
sizeof-long: 4
machine: x86_64
**
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

**
Microsoft Windows [Version 10.0.14393] 
** 
(64 bit)
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

** Path Option: Cmd
SSH Option: OpenSSH
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
Enable Builtin Difftool: Disabled
**
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

* No *

Details

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

* Problem exists in Bash and CMD and PowerShell*

** git **
  • What did you expect to occur after running these commands?

* I expected git to print out the command list and return to the prompt immediately *

  • What actually happened instead?

* The command list was printed and there is then a delay of 2-3 seconds before the prompt returns*

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

* Any repository and also outside of repositories *

mcve-required pending-answer unclear

Most helpful comment

@juliankopkalarsen I had the similar issue as yours on my Lenovo e450c laptop. And found the performance turned back to normal when I disabled AMD Radeon graphics driver in Windows device manager and switched to integrated Intel HD graphics.

All 27 comments

ymmv but last time I saw this, the culprit was an overzealous anti-malware process.

Maybe https://github.com/git-for-windows/git/wiki/Diagnosing-performance-issues has some hints to diagnose this further? (setting GIT_TRACE before calling C:\Program Files\Git\git-bash.exe may shed some light into it, for example.)

@adamwalling: I only have windows defender and have tried disabeling it temporarily (it restarts automatically) and adding exceptions to both the Programfiles/Git folder and git.exe

I Ran the following in the windows command prompt:

set GIT_TRACE=true
C:\Users\jkl>"c:Program Files\Git\git-bash.exe

Git-Bash took many seconds to start.
I then ran "git status" in an empty dummy repo:

$ git status
10:23:59.628312 git.c:371               trace: built-in: git 'status'
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)

and "time git status"

$ time git status
10:24:12.567800 git.c:371               trace: built-in: git 'status'
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)

real    0m2.047s
user    0m0.015s
sys     0m0.000s

and after setting GIT_TRACE_PERFORMANCE

 time git status
10:28:42.191298 git.c:371               trace: built-in: git 'status'
10:28:42.193303 trace.c:435             performance: 0.003313783 s: git command: 'C:\Program Files\Git\mingw64\bin\git.exe' 'status'
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)

real    0m2.046s
user    0m0.000s
sys     0m0.031s

The time command shows the problem of the command taking 2 seconds to return to the prompt, even though the git performance thinks it takes 0.003 s.

It may not be a git issue - I had a similar problem when I used powerline-shell as the prompt. What do the PROMPT_COMMAND and PS1 environment variables contain? Does it work better if you unset PROMPT_COMMAND and set PS1 to some simpler value like '\$ ' ?

@tehmul Neither PROMPT_COMMAND or PS1 are set in the windows command prompt where the problem also exists. Setting PS1="$" in git-bash does speed up the git-bash console because of the extra git branch information in the prompt, but that just bring is to the same speed as the windows command promt.

The timing command is still the same:

$time git status
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)

real    0m2.045s
user    0m0.000s
sys     0m0.000s

@adamwalling Thanks for cluing me in on this. I, too have been experiencing excruciating slowness with the past couple of releases of Git for Windows. However, I had forgotten that relatively recently I had updated my Trend Micro Maximum Protection security suite. On a whim, I added an exclusion for my Git for Windows installation path and I noticed a dramatic improvement in performance of Bash.

Another user on #1071 is using Malware Bytes and did not see an improvement when adding an exception, so I guess depending on the security suite in use, YMMV.

The time command shows the problem of the command taking 2 seconds to return to the prompt, even though the git performance thinks it takes 0.003 s.

Judging by the use of the time helper, you are running this in the Git Bash, right? Could you run which git (to find out whether it may be a problem with an alias or any other git.exe being used instead of the intended one)?

Also, it would be interesting to know whether the git.exe process is still running during those two seconds. If I were you, I would try to find out by running Sysinternals' Process Monitor side by side (starting tracing only close before, and stopping tracing soon after, the call to time git status). Hopefully this will help dig further into the direction of the root cause.

https://github.com/google/UIforETW can be a great way to investigate and diagnose issues like this on Windows machines, but it requires a pretty high level of technical competency. Process Monitor is friendlier but not as powerful, but may still help uncover the underlying problem.

I am using git-bash and "which git " returns /mingw64/bin/git

Using Process Monitor I can see that there is a full second from the git process terminates till the bash caller process terminates.

image

And here another where i call time git

image

And one in the dummy repo

image

I am not sure what to look for in either Process Monitor or ETW, do you have any tips?

Also I tried downgrading because work is to be done and it did not work.
And I have changed my windows locale from danish to english (US) also no luck.

I did the "Trace executions in the Bash startup" diagnostic step and got:

+ MSYS2_PATH=/usr/local/bin:/usr/bin:/bin
+ MANPATH=/usr/local/man:/usr/share/man:/usr/man:/share/man
+ INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info
+ case "${MSYS2_PATH_TYPE:-inherit}" in
+ ORIGINAL_PATH='/mingw64/bin:/usr/bin:/c/Users/jkl/bin:/c/Source/VMLib/ExternalDepencencies/bin/IPP903/intel64:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64_win/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32_win/compiler:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files (x86)/nodejs:/c/Program Files/Point Grey Research/FlyCapture2/bin64:/c/Program Files/Perforce/DVCS:/c/Program Files/JAI/SDK/bin:/c/Program Files/JAI/SDK/bin/Win32_i86:/c/Program Files/JAI/SDK/GenICam/bin/Win64_x64:/c/Program Files/JAI/SDK/GenICam/bin/Win32_i86:/c/Program Files (x86)/NuGet:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Program Files/TortoiseSVN/bin:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/dotnet:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI/wbin:/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn:/c/Program Files (x86)/Gource/cmd:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/Anaconda3:/c/Program Files/Anaconda3/Scripts:/c/Program Files/Anaconda3/Library/bin:/c/Program Files (x86)/Skype/Phone:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Users/jkl/AppData/Roaming/npm:/c/Program Files (x86)/Microsoft VS Code/bin:/c/Users/jkl/AppData/Local/Microsoft/WindowsApps'
+ unset MINGW_MOUNT_POINT
+ source /etc/msystem
++ export MSYSTEM=MINGW64
++ MSYSTEM=MINGW64
++ unset MSYSTEM_PREFIX
++ unset MSYSTEM_CARCH
++ unset MSYSTEM_CHOST
++ unset MINGW_CHOST
++ unset MINGW_PREFIX
++ unset MINGW_PACKAGE_PREFIX
++ unset CONFIG_SITE
++ case "${MSYSTEM}" in
++ MSYSTEM_PREFIX=/mingw64
++ MSYSTEM_CARCH=x86_64
++ MSYSTEM_CHOST=x86_64-w64-mingw32
++ MINGW_CHOST=x86_64-w64-mingw32
++ MINGW_PREFIX=/mingw64
++ MINGW_PACKAGE_PREFIX=mingw-w64-x86_64
++ CONFIG_SITE=/mingw64/etc/config.site
++ export MSYSTEM_PREFIX MSYSTEM_CARCH MSYSTEM_CHOST MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX CONFIG_SITE
+ case "${MSYSTEM}" in
+ MINGW_MOUNT_POINT=/mingw64
+ PATH='/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/jkl/bin:/c/Source/VMLib/ExternalDepencencies/bin/IPP903/intel64:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64_win/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32_win/compiler:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files (x86)/nodejs:/c/Program Files/Point Grey Research/FlyCapture2/bin64:/c/Program Files/Perforce/DVCS:/c/Program Files/JAI/SDK/bin:/c/Program Files/JAI/SDK/bin/Win32_i86:/c/Program Files/JAI/SDK/GenICam/bin/Win64_x64:/c/Program Files/JAI/SDK/GenICam/bin/Win32_i86:/c/Program Files (x86)/NuGet:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Program Files/TortoiseSVN/bin:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/dotnet:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI/wbin:/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn:/c/Program Files (x86)/Gource/cmd:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/Anaconda3:/c/Program Files/Anaconda3/Scripts:/c/Program Files/Anaconda3/Library/bin:/c/Program Files (x86)/Skype/Phone:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Users/jkl/AppData/Roaming/npm:/c/Program Files (x86)/Microsoft VS Code/bin:/c/Users/jkl/AppData/Local/Microsoft/WindowsApps'
+ PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
+ ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal
+ MANPATH=/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man
+ MAYBE_FIRST_START=false
+ SYSCONFDIR=/etc
+ ORIGINAL_TMP=/tmp
+ ORIGINAL_TEMP=/tmp
+ case "$TMP" in
+ case "$TEMP" in
+ test -d ''
+ test '!' -d /tmp
+ TMPDIR=/tmp
+ export TMPDIR
+ p='/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device'
+ '[' -e '/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device' ']'
+ read -r PRINTER
+ PRINTER='\\kappa.proinvent.dk\HPM551N Farvelaser Videometer'
+ unset p
++ export LC_COLLATE=C
++ LC_COLLATE=C
++ echo '/etc/post-install/*.post'
+ for postinst in '$(export LC_COLLATE=C; echo /etc/post-install/*.post)'
+ '[' -e '/etc/post-install/*.post' ']'
+ '[' '!' 'x4.3.46(2)-release' = x ']'
++ /usr/bin/hostname
+ HOSTNAME=JKL-E460-W10
+ profile_d sh
+ local file=
++ export LC_COLLATE=C
++ LC_COLLATE=C
++ echo /etc/profile.d/aliases.sh /etc/profile.d/bash_profile.sh /etc/profile.d/env.sh /etc/profile.d/git-prompt.sh /etc/profile.d/lang.sh /etc/profile.d/perlbin.sh
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/aliases.sh ']'
+ . /etc/profile.d/aliases.sh
++ alias 'ls=ls -F --color=auto --show-control-chars'
++ alias 'll=ls -l'
++ case "$TERM" in
++ for name in node ipython php php5 psql python2.7
++ case "$(type -p "$name".exe 2>/dev/null)" in
+++ type -p node.exe
++ alias 'node=winpty node.exe'
++ for name in node ipython php php5 psql python2.7
++ case "$(type -p "$name".exe 2>/dev/null)" in
+++ type -p ipython.exe
++ alias 'ipython=winpty ipython.exe'
++ for name in node ipython php php5 psql python2.7
++ case "$(type -p "$name".exe 2>/dev/null)" in
+++ type -p php.exe
++ continue
++ for name in node ipython php php5 psql python2.7
++ case "$(type -p "$name".exe 2>/dev/null)" in
+++ type -p php5.exe
++ continue
++ for name in node ipython php php5 psql python2.7
++ case "$(type -p "$name".exe 2>/dev/null)" in
+++ type -p psql.exe
++ continue
++ for name in node ipython php php5 psql python2.7
++ case "$(type -p "$name".exe 2>/dev/null)" in
+++ type -p python2.7.exe
++ continue
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/bash_profile.sh ']'
+ . /etc/profile.d/bash_profile.sh
++ '[' -e /c/Users/jkl/.bashrc -a '!' -e /c/Users/jkl/.bash_profile -a '!' -e /c/Users/jkl/.bash_login -a '!' -e /c/Users/jkl/.profile ']'
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/env.sh ']'
+ . /etc/profile.d/env.sh
++ export 'PATH=/c/Users/jkl/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/jkl/bin:/c/Source/VMLib/ExternalDepencencies/bin/IPP903/intel64:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64_win/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32_win/compiler:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files (x86)/nodejs:/c/Program Files/Point Grey Research/FlyCapture2/bin64:/c/Program Files/Perforce/DVCS:/c/Program Files/JAI/SDK/bin:/c/Program Files/JAI/SDK/bin/Win32_i86:/c/Program Files/JAI/SDK/GenICam/bin/Win64_x64:/c/Program Files/JAI/SDK/GenICam/bin/Win32_i86:/c/Program Files (x86)/NuGet:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Program Files/TortoiseSVN/bin:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/dotnet:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI/wbin:/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn:/c/Program Files (x86)/Gource/cmd:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/Anaconda3:/c/Program Files/Anaconda3/Scripts:/c/Program Files/Anaconda3/Library/bin:/c/Program Files (x86)/Skype/Phone:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Users/jkl/AppData/Roaming/npm:/c/Program Files (x86)/Microsoft VS Code/bin:/c/Users/jkl/AppData/Local/Microsoft/WindowsApps'
++ PATH='/c/Users/jkl/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/jkl/bin:/c/Source/VMLib/ExternalDepencencies/bin/IPP903/intel64:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64_win/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32_win/compiler:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files (x86)/nodejs:/c/Program Files/Point Grey Research/FlyCapture2/bin64:/c/Program Files/Perforce/DVCS:/c/Program Files/JAI/SDK/bin:/c/Program Files/JAI/SDK/bin/Win32_i86:/c/Program Files/JAI/SDK/GenICam/bin/Win64_x64:/c/Program Files/JAI/SDK/GenICam/bin/Win32_i86:/c/Program Files (x86)/NuGet:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Program Files/TortoiseSVN/bin:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/dotnet:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI/wbin:/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn:/c/Program Files (x86)/Gource/cmd:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/Anaconda3:/c/Program Files/Anaconda3/Scripts:/c/Program Files/Anaconda3/Library/bin:/c/Program Files (x86)/Skype/Phone:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Users/jkl/AppData/Roaming/npm:/c/Program Files (x86)/Microsoft VS Code/bin:/c/Users/jkl/AppData/Local/Microsoft/WindowsApps'
++ test -n ''
++ case "$MSYSTEM" in
++ export DISPLAY=needs-to-be-defined
++ DISPLAY=needs-to-be-defined
++ export SSH_ASKPASS=/mingw64/libexec/git-core/git-gui--askpass
++ SSH_ASKPASS=/mingw64/libexec/git-core/git-gui--askpass
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/git-prompt.sh ']'
+ . /etc/profile.d/git-prompt.sh
++ test -f /etc/profile.d/git-sdk.sh
++ TITLEPREFIX=MINGW64
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h '
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM '
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w'
++ test -z ''
+++ git --exec-path
++ GIT_EXEC_PATH='C:\Program Files\Git\mingw64/libexec/git-core'
++ COMPLETION_PATH='C:\Program Files\Git\mingw64'
++ COMPLETION_PATH='C:\Program Files\Git\mingw64'
++ COMPLETION_PATH='C:\Program Files\Git\mingw64/share/git/completion'
++ test -f 'C:\Program Files\Git\mingw64/share/git/completion/git-prompt.sh'
++ . 'C:\Program Files\Git\mingw64/share/git/completion/git-completion.bash'
+++ case "$COMP_WORDBREAKS" in
+++ : great
+++ type _get_comp_words_by_ref
+++ __git_merge_strategies=
+++ __git_all_commands=
+++ __git_porcelain_commands=
+++ __git_whitespacelist='nowarn warn error error-all fix'
+++ __git_untracked_file_modes='all no normal'
+++ __git_diff_algorithms='myers minimal patience histogram'
+++ __git_diff_submodule_formats='log short'
+++ __git_diff_common_options='--stat --numstat --shortstat --summary
                        --patch-with-stat --name-only --name-status --color
                        --no-color --color-words --no-renames --check
                        --full-index --binary --abbrev --diff-filter=
                        --find-copies-harder
                        --text --ignore-space-at-eol --ignore-space-change
                        --ignore-all-space --ignore-blank-lines --exit-code
                        --quiet --ext-diff --no-ext-diff
                        --no-prefix --src-prefix= --dst-prefix=
                        --inter-hunk-context=
                        --patience --histogram --minimal
                        --raw --word-diff --word-diff-regex=
                        --dirstat --dirstat= --dirstat-by-file
                        --dirstat-by-file= --cumulative
                        --diff-algorithm=
                        --submodule --submodule=
'
+++ __git_mergetools_common='diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
                        tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc codecompare
'
+++ __git_fetch_recurse_submodules='yes on-demand no'
+++ __git_fetch_options='
        --quiet --verbose --append --upload-pack --force --keep --depth=
        --tags --no-tags --all --prune --dry-run --recurse-submodules=
'
+++ __git_format_patch_options='
        --stdout --attach --no-attach --thread --thread= --no-thread
        --numbered --start-number --numbered-files --keep-subject --signoff
        --signature --no-signature --in-reply-to= --cc= --full-index --binary
        --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
        --inline --suffix= --ignore-if-in-upstream --subject-prefix=
        --output-directory --reroll-count --to= --quiet --notes
'
+++ __git_log_common_options='
        --not --all
        --branches --tags --remotes
        --first-parent --merges --no-merges
        --max-count=
        --max-age= --since= --after=
        --min-age= --until= --before=
        --min-parents= --max-parents=
        --no-min-parents --no-max-parents
'
+++ __git_log_gitk_options='
        --dense --sparse --full-history
        --simplify-merges --simplify-by-decoration
        --left-right --notes --no-notes
'
+++ __git_log_shortlog_options='
        --author= --committer= --grep=
        --all-match --invert-grep
'
+++ __git_log_pretty_formats='oneline short medium full fuller email raw format:'
+++ __git_log_date_formats='relative iso8601 rfc2822 short local default raw'
+++ __git_merge_options='
        --no-commit --no-stat --log --no-log --squash --strategy
        --commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit
        --verify-signatures --no-verify-signatures --gpg-sign
        --quiet --verbose --progress --no-progress
'
+++ __git_push_recurse_submodules='check on-demand'
+++ __git_send_email_confirm_options='always never auto cc compose'
+++ __git_send_email_suppresscc_options='author self cc bodycc sob cccmd body all'
+++ [[ -n '' ]]
+++ __git_complete git __git_main
+++ local wrapper=__git_wrap__git_main
+++ eval '__git_wrap__git_main () { __git_func_wrap __git_main ; }'
+++ complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git
+++ __git_complete gitk __gitk_main
+++ local wrapper=__git_wrap__gitk_main
+++ eval '__git_wrap__gitk_main () { __git_func_wrap __gitk_main ; }'
+++ complete -o bashdefault -o default -o nospace -F __git_wrap__gitk_main gitk
++++ uname -o
+++ '[' Cygwin = Msys ']'
++ . 'C:\Program Files\Git\mingw64/share/git/completion/git-prompt.sh'
+++ __git_printf_supports_v=
+++ printf -v __git_printf_supports_v -- %s yes
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n'
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '
++ MSYS2_PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/lang.sh ']'
+ . /etc/profile.d/lang.sh
++ test -z ''
+++ /usr/bin/locale -uU
++ export LANG=en_US.UTF-8
++ LANG=en_US.UTF-8
+ for file in '$(export LC_COLLATE=C; echo /etc/profile.d/*.$1)'
+ '[' -e /etc/profile.d/perlbin.sh ']'
+ . /etc/profile.d/perlbin.sh
++ '[' -d /usr/bin/site_perl ']'
++ '[' -d /usr/lib/perl5/site_perl/bin ']'
++ '[' -d /usr/bin/vendor_perl ']'
++ PATH='/c/Users/jkl/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/jkl/bin:/c/Source/VMLib/ExternalDepencencies/bin/IPP903/intel64:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64_win/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32_win/compiler:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files (x86)/nodejs:/c/Program Files/Point Grey Research/FlyCapture2/bin64:/c/Program Files/Perforce/DVCS:/c/Program Files/JAI/SDK/bin:/c/Program Files/JAI/SDK/bin/Win32_i86:/c/Program Files/JAI/SDK/GenICam/bin/Win64_x64:/c/Program Files/JAI/SDK/GenICam/bin/Win32_i86:/c/Program Files (x86)/NuGet:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Program Files/TortoiseSVN/bin:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/dotnet:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI/wbin:/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn:/c/Program Files (x86)/Gource/cmd:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/Anaconda3:/c/Program Files/Anaconda3/Scripts:/c/Program Files/Anaconda3/Library/bin:/c/Program Files (x86)/Skype/Phone:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Users/jkl/AppData/Roaming/npm:/c/Program Files (x86)/Microsoft VS Code/bin:/c/Users/jkl/AppData/Local/Microsoft/WindowsApps:/usr/bin/vendor_perl'
++ '[' -d /usr/lib/perl5/vendor_perl/bin ']'
++ '[' -d /usr/bin/core_perl ']'
++ PATH='/c/Users/jkl/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/jkl/bin:/c/Source/VMLib/ExternalDepencencies/bin/IPP903/intel64:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64_win/compiler:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/ia32_win/compiler:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files (x86)/nodejs:/c/Program Files/Point Grey Research/FlyCapture2/bin64:/c/Program Files/Perforce/DVCS:/c/Program Files/JAI/SDK/bin:/c/Program Files/JAI/SDK/bin/Win32_i86:/c/Program Files/JAI/SDK/GenICam/bin/Win64_x64:/c/Program Files/JAI/SDK/GenICam/bin/Win32_i86:/c/Program Files (x86)/NuGet:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Program Files/TortoiseSVN/bin:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/dotnet:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI/wbin:/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn:/c/Program Files (x86)/Gource/cmd:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/Anaconda3:/c/Program Files/Anaconda3/Scripts:/c/Program Files/Anaconda3/Library/bin:/c/Program Files (x86)/Skype/Phone:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/Users/jkl/AppData/Roaming/npm:/c/Program Files (x86)/Microsoft VS Code/bin:/c/Users/jkl/AppData/Local/Microsoft/WindowsApps:/usr/bin/vendor_perl:/usr/bin/core_perl'
++ export PATH
+ '[' -n /mingw64 ']'
++ export LC_COLLATE=C
++ LC_COLLATE=C
++ echo '/mingw64/etc/profile.d/*.sh'
+ for file in '$(export LC_COLLATE=C; echo ${MINGW_MOUNT_POINT}/etc/profile.d/*.$1)'
+ '[' -e '/mingw64/etc/profile.d/*.sh' ']'
+ '[' -f /etc/bash.bashrc ']'
+ . /etc/bash.bashrc
++ [[ -z '' ]]
++ CYG_SYS_BASHRC=1
++ [[ himxBH != *i* ]]
++ unset _warning_found
++ for _warning_prefix in ''\'''\''' '${MINGW_PREFIX}'
++ for _warning_file in '${_warning_prefix}/etc/profile.d/*.warning{.once,}'
++ test -f '/etc/profile.d/*.warning.once'
++ continue
++ for _warning_file in '${_warning_prefix}/etc/profile.d/*.warning{.once,}'
++ test -f '/etc/profile.d/*.warning'
++ continue
++ for _warning_prefix in ''\'''\''' '${MINGW_PREFIX}'
++ for _warning_file in '${_warning_prefix}/etc/profile.d/*.warning{.once,}'
++ test -f '/mingw64/etc/profile.d/*.warning.once'
++ continue
++ for _warning_file in '${_warning_prefix}/etc/profile.d/*.warning{.once,}'
++ test -f '/mingw64/etc/profile.d/*.warning'
++ continue
++ unset _warning_found
++ unset _warning_prefix
++ unset _warning_file
++ unset _warning
++ [[ -n \[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$  ]]
++ export 'PS1=\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '
++ PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '
+++ declare -p PS1
+++ cut -c 1-11
++ [[ declare -x  = \d\e\c\l\a\r\e\ \-\x\  ]]
++ shopt -q login_shell
+ '[' -n /mingw64/share/aclocal:/usr/share/aclocal ']'
+ export ACLOCAL_PATH
+ export PATH MANPATH INFOPATH PKG_CONFIG_PATH USER TMP TEMP PRINTER HOSTNAME PS1 SHELL tmp temp ORIGINAL_TMP ORIGINAL_TEMP ORIGINAL_PATH
+ unset PATH_SEPARATOR
+ '[' false = true ']'
+ unset MAYBE_FIRST_START
++ __git_ps1
++ local exit=0
++ local pcmode=no
++ local detached=no
++ local 'ps1pc_start=\u@\h:\w '
++ local 'ps1pc_end=\$ '
++ local 'printf_format= (%s)'
++ case "$#" in
++ printf_format=' (%s)'
++ local ps1_expanded=yes
++ '[' -z '' ']'
++ '[' -z '4.3.46(2)-release' ']'
++ shopt -q promptvars
++ local repo_info rev_parse_exit_code
+++ git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
++ repo_info=
++ rev_parse_exit_code=128
++ '[' -z '' ']'
++ return 0

@juliankopkalarsen I had the similar issue as yours on my Lenovo e450c laptop. And found the performance turned back to normal when I disabled AMD Radeon graphics driver in Windows device manager and switched to integrated Intel HD graphics.

?!?! I have a Lenovo e460 and it worked !?!
To clarify: When I disabled the AMD Radeon graphics driver in Windows device manager the speed returned to normal.

$ time git status
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)

real    0m0.047s
user    0m0.015s
sys     0m0.000s

@juliankopkalarsen Cheers! LOL

@juliankopkalarsen I'm glad to hear that you found the root cause. Are we able to close this out?

Should I create a new issue with the clear cause or "Take it up with AMD" ?

@juliankopkalarsen nah, I don't think it's worth trying to fix this in Git for Windows (if that's even possible).

It might be worth getting in touch with AMD but at least we have this written up as a cautionary tale for others...

Posted similar info in the related issue - but yes, AMD Radeon can definitely be involved:

Bringing up the Radeon settings GUI and clicking on something while waiting for the bash prompt immediately releases something and makes it appear - weird.

I have contacted AMD tech support and will update with anything they might share.

@trowpa do You have any info how to fix it? I've got same issue with AMD driver

@trowpa, can you please provide a link to a possibly existing AMD support ticket? Maybe the people affected by this problem can somehow comment or upvote on it. It seems people are still interested in this issue, given the fact that this StackOverflow issue currently has a bounty on it.

I think it's already fixed. I havn't noticed any similar problems with the newest AMD driver.

Hmm... then I find it strange that someone put a bounty on it just this week on SO.

disabling the AMD graphics card made my git bash run wayy faster

In my opinion this should be fixed in Git. Why would a properly implemented command line tool get slow because of a graphics driver? Deactivating the better of my two graphics cards just to make Git behave normally is clearly overkill.

@kriegaex clearly "this should be fixed in Git", however it does need fellow open source contributions to determine the [root cause] source of the issue, so that root cause [which maybe at AMD] can also be fixed.
(on another tool (corporate install) I had to IIRC switch off a compatibility mode, switching back to 'basic' graphics without aero, some times the fix never happens..)

I'd guess that the AMD driver folk think they have a reasonable driver, so aren't actively looking for the issue, and 'we' (IIUC) haven't created an MVCE that points out just what the underlying issue is, or it's work around.

The Git team is us, the sum of our limited capabilities and capacities. All help welcomed.

I cannot contribute much to analysing or fixing the problem, as Git is not being developed in any of the languages I am fluent in, such as Java. I am a mere user and do not have the problem on my current device, my old one still exists but is located elsewhere now.

Maybe some kind of differential analysis helps: Git is, as I said, IMO a command-line tool but on windows uses a special terminal emulation (Git Bash, MSYS shell). If e.g. the problem would only exist in Git Bash, but not in cmd.exe (which is to be verified), at least the root cause would have been narrowed down to that part of the application package. Then it would make sense to think about which graphics driver features Git Bash actually uses and how that could affect performance on an AMD-powered device. From that point the analysis could be further detailed, narrowing down more on possible root causes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Snaptags picture Snaptags  路  4Comments

dscho picture dscho  路  3Comments

Unknow0059 picture Unknow0059  路  3Comments

JoshSchreuder picture JoshSchreuder  路  4Comments

drewnoakes picture drewnoakes  路  5Comments