1

This is related to Git Bash (mintty) is extremely slow on Windows 10 OS, but I have also noticed after using Process Monitor that bash.exe is launched 15-20 times in succession when I launch Git Bash from explorer (see screenshot below), which is why it takes 7s (from 12:20:01 to 12:20:07).

Any idea what causes this issue? In particular, is bash.exe trying to use fork() somehow that doesn't work well with Windows 10?

enter image description here

torek
  • 448,244
  • 59
  • 642
  • 775
sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • Check the details column to know about the command line. Probably it's just processing your .bashrc file. – CherryDT Apr 14 '22 at 09:37
  • Bash is invoked with the same command line every time - `C:\Users\MyUser\AppData\Local\Programs\Git\usr\bin\bash.exe --login -i`. – sashoalm Apr 14 '22 at 09:39
  • @CherryDT I renamed my .bash_profile and .bash_history (there was no .bashrc) but it still gets invoked 15-20 times so it's not that. – sashoalm Apr 14 '22 at 09:42
  • This in itself wouldn't surprise me too much. There's many ways to create short-lived sub-shells in bash and it's likely/possible that some of your init scripts (or even internal ones) trigger this. And unless all of these processes run for a long time, I wouldn't worry about this. One issue with porting Unix-tools to Windows directly is that process creations is *much slower* on Windows than in Unix (that's not usually a problem, it's just a difference in "philosophy", but causes problems when directly running tools written for unix-like OS). – Joachim Sauer Apr 14 '22 at 09:43
  • 1
    I checked it on my system and it's the same, around 30 processes created and exited again during startup of bash. It looks like it's normal. However, for me this whole process takes 0.7 seconds and not 7 seconds, so something else must be the issue in your case. Maybe you have an overly-eager antivirus software delaying a lot of the file accesses? Or could there be a network path in your `PATH`? – CherryDT Apr 14 '22 at 09:52
  • @CherryDT, OK so it's normal. In that case that answers my question, I guess - multiple processes are a normal thing and not the cause of the slowdown. Could you post that as an answer in that case? – sashoalm Apr 14 '22 at 17:21
  • With a starting state of no git.exe process, I run git-bash on repo1 and do `git status`, 9 git processes appear (`git fsmonitor--daemon run --free-console --ipc-threads=8`). If I exit git-bash, the processes remain. When I run git-bash again and do another `git status`, no new git processes appear - it might be using the initial set. If I cd to repo2 and do `git status`, 34 more git processes appear. It looks like these processes are monitoring repo directories to improve performance --> https://gitirc.eu/git-fsmonitor--daemon.html. – Bill Hoag Apr 20 '22 at 17:31

0 Answers0