Git is extremely slow on Windows

19

6

I'm not sure what have been changed, but my Git installation started to be extremely slow on an average-sized repository. Others use Git with the same repository on similar machines.

Various commands working with local files are slow, e.g. status & commit. push is fast.

Windows 10, Git 2.11.0 64 bit, high CPU consumption.

Typical problems and solutions already ruled out:

  • Antivirus
  • Network drive
  • core.fscache

time git status (from git-bash aka MinGW):

real    0m29.017s
user    0m0.015s
sys     0m0.031s

Tracing performance with GIT_TRACE_PERFORMANCE=true git status unfortunately has shown only a single atomic chunk:

performance: 32.583549907 s: git command: git status

kirilloid

Posted 2016-12-26T15:23:21.687

Reputation: 291

I cannot speak to your issues in particular, but I recommend starting with prune. It should lighten the load on other operations you attempt. Good luck! – eebbesen – 2016-12-26T16:10:01.363

git prune && git gc (took really long) w/o any noticeable effect. – kirilloid – 2016-12-26T16:24:24.303

hmm, try http://stackoverflow.com/a/24045966/2317829 which may be related. Also, it would be interesting to see some tracing output of the slow operations (e.g. GIT_TRACE_PERFORMANCE=true git status)

– eebbesen – 2016-12-26T20:57:41.090

I've tried all of these. tracing status gave no insights (see updated post) – kirilloid – 2016-12-27T10:50:34.470

Is it still slow with less CPU consumption? – Seth – 2016-12-27T11:37:43.727

1

compile git (https://github.com/git-for-windows/git.git) on your own with Visual Studio (https://github.com/git-for-windows/git/commit/056b41311688e9f433fe28e6b3aa6687fa36ca70) to get PDBs. Now open cmd.exe as admin and run this: wpr.exe -start CPU -start ReferenceSet -filemode && timeout -1 && wpr.exe -stop C:\HighCPUUsage.etl. now do your slow git actions. after you did this, go back to CMD and press a key to stop logging. Zip the large ETL + your own generated PDbs for git and share the zip (onedrive share link)

– magicandre1981 – 2016-12-27T12:15:04.037

1Unfortunately at some point git become fast again and support engineers are unable to tell me what has been changed in the repo. – kirilloid – 2017-04-07T10:14:09.823

1

I can no longer add an answer to this question, but I had the same issue, fixed it, and I want to document it for whoever lands on this page again. Simply upgrading to Git 2.15 from 2.14 (not even opening a new terminal) gave me a 3x git status speedup. I believe it's this: https://github.com/git-for-windows/git/pull/1344

– alejandro5042 – 2017-12-29T23:18:21.180

@RaghuRanganathan first two options were enabled by default in my version of git, the third one won't work—I tried to run git gc manually several times with no visible improvements. – kirilloid – 2018-04-15T18:21:44.010

1I had this problem because my home folder (containing the .gitconfig) was on a network share. I fixed it by installing MSYS, and then installing git into MSYS with pacman -S git. This works because MSYS has a separate home folder. – jpaugh – 2018-05-02T13:29:01.977

I'm voting to close this question as off-topic because it's no longer reproducible as per OP comment.

– kenorb – 2018-05-02T14:03:44.880

Answers

3

This Stack Overflow post worked for me: Git Bash (mintty) is extremely slow on Windows 10 OS

Old question, I know, but I recently encountered the problem and found the answer - so thought I'd proliferate. Essentially, it was an issue with the AMD Radeon Graphics Driver slowing down mintty. Go to Device Manager, and disable AMD Radeon Graphics in favor of Intel Integrated Graphics. I've tried to find out why, but no luck so far.

Abi

Posted 2016-12-26T15:23:21.687

Reputation: 31

2

So did this solution work for you are not because you are writing an answer and if you have not confirmed the posted solution you write about, then it's not really an answer and therefore you should read over "Why do I need 50 reputation to comment" to ensure you understand how you can start commenting.

– Pimp Juice IT – 2017-08-11T19:03:17.013

I had only intel graphic chipset on that machine, so it's like I already did that. Also from my understanding of how modern software utilizes hardware, the chances mintty utilize GPU somehow are pretty slim.

There might be a bug in a driver making CPU stuck, but it's also very improbable situation.

Ah, and I don't even use minGW console — I use standard windows cmd with executables added to the PATH. – kirilloid – 2017-08-15T09:45:06.760

Holly... this worked for me. Did you have any luck finding out why this happens? @Abi – pmoleri – 2018-10-06T04:46:38.910

1Disabling your graphics driver!!!!??? Not a solution. – Triynko – 2019-02-01T18:45:36.693