简体   繁体   中英

VS 2015 High CPU Usage on File Save

With Visual Studio 2015 I have noticed that if I have multiple solutions open with a common project to all solutions, if I so much as edit and save one .cs file belonging to the common project, all Visual Studio 2015 instances will consume CPU for 10-15 seconds. Note that the common project is fairly large.

I don't recall this happening with Visual Studio 2013. It is common in my workflow to have 8-9 instances of Visual Studio open all with solutions referencing the common project, so I feel as though I would have noticed this behavior with Visual Studio 2013 (my development machine has 32 GB of RAM which makes this type of workflow possible).

I have tried:

  1. Disabling CodeLens
  2. Uninstalling ReSharper
  3. Disabling the four C# Intellisense features found in Tools->Options
  4. Temporarily Disabling Static Code Analysis Solution Wide (for all loaded solutions)

I also launched a separate instance of Visual Studio 2015, enabled Microsoft Symbol Servers and profiled (via Debug-> Profiler-> Performance Explorer -> Attach/Detach) an offending Visual Studio instance while it was consuming High CPU.

This image shows the profiler summary and you can see from the graph high CPU usage between ~12s and ~27s.

Profiler摘要

84.46% of the samples were in Thread::intermediateThreadProc, and the majority were exclusive samples, but of the inclusive samples, it appears as though it was doing some sort of code analysis.

Profiler呼叫树

With this information I assume that some sort of background code analysis is being performed with all Visual Studio 2015 instances (including those in the background). Does anyone know how to disable this? Or if my assumption is incorrect, any other suggestions?

Update 9/12/2015 Interestingly, if I perform the same profiling with ReSharper 9.2 installed, I get a similar result, but with JetBrains.Platform.Satellite.exe at the root of the "Hot Path" (instead of devenv.exe).

Profiler摘要ReSharper

Update 10/11/2015

I believe this is the issue:

How to disable real time compilation in Visual Studio 2015

Is there a way to disable real time compilation on save? Or at least have it not be so intrusive? The operation most likely to follow "Save" is "Build", and because all of the visual studio instances are recompiling their respective solutions (without being asked), the "Build" operation in the active solution is severely hindered.

在这里找到( http://www.itgo.me/a/x8021838007883560399/how-to-disable-real-time-compilation-in-visual-studio-2015 ):“转到工具,选项,文本编辑器,C#,高级和取消选中启用完整的解决方案分析。这应该可以解决您的问题,因为除非您构建解决方案,否则不会每次都检查解决方案。“

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM