VS 2015 文件保存时 CPU 使用率高 [英] VS 2015 High CPU Usage on File Save

查看:63
本文介绍了VS 2015 文件保存时 CPU 使用率高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio 2015 中,我注意到如果我打开多个解决方案,其中包含所有解决方案的公共项目,如果我编辑并保存一个属于公共项目的 .cs 文件,则所有 Visual Studio 2015 实例都将消耗CPU 10-15 秒.请注意,公共项目相当大.

我不记得在 Visual Studio 2013 中发生过这种情况.在我的工作流中打开 8-9 个 Visual Studio 实例并使用引用公共项目的解决方案是很常见的,所以我感觉好像我会注意到这种行为使用 Visual Studio 2013(我的开发机器有 32 GB 的 RAM,这使得这种类型的工作流程成为可能).

我试过了:

  1. 禁用 CodeLens
  2. 卸载 ReSharper
  3. 禁用工具->选项中的四个 C# Intellisense 功能
  4. 84.46% 的样本在 Thread::intermediateThreadProc 中,并且大多数是独占样本,但在包含样本中,它似乎在进行某种代码分析.

    根据这些信息,我假设正在对所有 Visual Studio 2015 实例(包括后台的实例)执行某种后台代码分析.有谁知道如何禁用它?或者,如果我的假设不正确,还有其他建议吗?

    2015 年 9 月 12 日更新有趣的是,如果我在安装了 ReSharper 9.2 的情况下执行相同的分析,我会得到类似的结果,但在热路径"的根目录下使用 JetBrains.Platform.Satellite.exe(而不是 devenv.exe).

    10/11/2015 更新

    我认为这是问题所在:

    如何在 Visual Studio 中禁用实时编译2015

    有没有办法在保存时禁用实时编译?或者至少它没有那么烦人?保存"之后最有可能的操作是构建",由于所有的visual studio实例都在重新编译各自的解决方案(没有被询问),活动解决方案中的构建"操作受到严重阻碍.

    解决方案

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

    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.

    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.

    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).

    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.

    解决方案

    Found here (http://www.itgo.me/a/x8021838007883560399/how-to-disable-real-time-compilation-in-visual-studio-2015) : "go to tools, options, text editor, C#, Advanced and uncheck Enable full solution analysis. This should stop your problem as the solution won't be checked every time unless you build it."

    这篇关于VS 2015 文件保存时 CPU 使用率高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆