How to save git in Visual Studio from consuming a constant 35% processor?

For some time I watched how git support for Visual Studio 2013 constantly consumes a large amount of my processor. I tried Mark Rendle's methods to disable git. At some point, deleting all registry keys to support git worked fine. However, with Update 2, this method no longer works. I also tried extending it, but that doesn't help.

I know this is related to git because I ran the profiler in Visual Studio and the results were completely clear.

enter image description here

I get this surge in CPU usage for 30-60 seconds anytime I save a file. When editing code, this is pretty common. If I have other instances of Visual Studio open at the same time, other instances will also see a similar CPU spike. Thus, when opening 4 instances of Visual Studio, I will see the full 100% CPU utilization when merging all instances. This is very annoying and makes the boundary area of ​​Visual Studio unusable at some points.

Is there a way around this method or method to truly disable git support in Visual Studio 2013?

+6
source share
2 answers

I can't talk to the above NoGit Extension to disable the git extension, but I heard good things about it. However, this is a workaround for your problem, not an actual solution.

Visual Studio connects a file system listener in the working directory of the git repository to determine the changes: for example, when switching branches, we change the branch selection in Team Explorer. Similarly, when editing a file, we decorate this file as modified in Solution Explorer and in Team Explorer.

This is usually not an expensive check, however, if you have a lot of file system crashes (e.g. build!) In places that should be, but not in your .gitignore (e.g. for build!), Then this is stupid insanely expensive.

Please check three times that your .gitignore file .gitignore configured to properly ignore assembly output. Make sure that when this happens, git status does not report assembly output or auto-generated files.

If you think that it is configured correctly, consult me ​​by e-mail and we can try to determine if there is an error in the ignore comparison logic.

+1
source

I just found a solution on github that worked for me: "Run git rev-parse --show-toplevel. It will tell you where the root of this git repository is located. It will be inside the .git folder. Just delete it.

Caution: This destroys the local git repository history.

-1
source

Source: https://habr.com/ru/post/972615/


All Articles