visual-studio ReSharper 迟钝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/84009/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 16:31:36  来源:igfitidea点击:

ReSharper sluggishness

visual-studioperformanceideresharper

提问by Todd Williamson

I like ReSharper, but it is a total memory hog. It can quickly swell up and consume a half-gig of RAM without too much effort and bog down the IDE. Does anybody know of any way to configure it to be not as slow?

我喜欢 ReSharper,但它完全是一个内存猪。它可以迅速膨胀并消耗一半的 RAM,而无需太多努力并使 IDE 陷入困境。有人知道有什么方法可以将其配置为不那么慢吗?

采纳答案by cynicalman

Turn off the on-the-fly compilation (which, unfortunately, is one of its best features)

关闭即时编译(不幸的是,这是其最佳功能之一)

回答by cynicalman

The next release 4.5 is going to based around performance and memory footprint.

下一个版本 4.5 将基于性能和内存占用。

see Ilya Ryzhenkov'sblog

Ilya Ryzhenkov 的博客

Resharper 4.5 has been releasedFrom my experience it is less of a memory hog, but i still can run out of memory.

Resharper 4.5 已经发布根据我的经验,它不太占用内存,但我仍然会耗尽内存。

回答by Josh Buedel

I had an issue where it was taking upwards of 10 minutes to load a solution of 100+ projects. Once loaded VS performance would be ok, though it would oddly flutter back and forth between ok and really bad.

我遇到了一个问题,加载 100 多个项目的解决方案需要 10 分钟以上的时间。一旦加载 VS 性能就可以了,尽管它会奇怪地在正常和非常糟糕之间来回摆动。

The short answer: Eliminating Resharper warnings seems to improve overall VS/R# performance.

简短的回答:消除 Resharper 警告似乎可以提高整体 VS/R# 性能。

The biggest problem ultimately was that we had a number of files of binary data (encrypted stuff) being included as embedded resources, which happened to have .xml extensions. Resharper was trying really really hard to analyze those files. Eventually it'd get through but would generate 100K+ errors in the process. Changing the extension to one Resharper did not automatically analyze (.bin in this case) solved the problem.

最大的问题最终是我们有许多二进制数据文件(加密的东西)作为嵌入资源包含在内,这些文件恰好具有 .xml 扩展名。Resharper 真的非常努力地分析这些文件。最终它会通过,但会在此过程中产生 100K+ 错误。将扩展名更改为 Resharper 并没有自动分析(在这种情况下为 .bin)解决了问题。

We still have about 10 files which when they or a file they depend on is edited performance tanks for a while. These files are the partial parts of a single class definition where each file averages 3000 LOC. Yes, that's right, it's about a 30K line class. It also happens to be rather poor code for other reasons, many of which Resharper flags making the right hand gutter bar practically a solid orange line. Editing often causes Resharper to reanalyze the whole thing. While that analysis runs, performance is noticeably affected.

我们仍然有大约 10 个文件,当它们或它们依赖的文件被编辑一段时间的性能坦克时。这些文件是单个类定义的部分部分,其中每个文件平均 3000 LOC。是的,没错,大约是 30K 线类。由于其他原因,它也恰好是相当糟糕的代码,其中许多 Resharper 标记使右侧的装订线条实际上是一条橙色实线。编辑通常会导致 Resharper 重新分析整个事情。当该分析运行时,性能会受到明显影响。

I've come to the conclusion that the less errors/warnings there are for R# to identify, the better it performs. My anecdotal evidence gathered while cleaning up/refactoring this project seems to support it.

我得出的结论是,R# 识别的错误/警告越少,它的性能就越好。我在清理/重构这个项目时收集的轶事证据似乎支持它。

A lot of folks complain of perf problems with Resharper. If you have even a few big ugly code files with lots of Resharper warnings, then a little time spent cleaning that code up might yield better performance overall. It has for us.

许多人抱怨 Resharper 的性能问题。如果您甚至有一些带有大量 Resharper 警告的丑陋的大代码文件,那么花一点时间清理这些代码可能会产生更好的整体性能。它对我们有。

回答by Leon Breedt

Not sure how big your solutions are, but I stopped using 4.5 for the same reasons I stopped using all previous versions, memory usage.

不确定您的解决方案有多大,但我停止使用 4.5 的原因与我停止使用所有以前的版本、内存使用情况相同。

Code analysis and unit test support was the main reason I bought it, turning it off means the rationale for using it is gone.

代码分析和单元测试支持是我购买它的主要原因,关闭它意味着使用它的理由不复存在。

Workstation has 4GB of memory, and I can easily kill it with ReSharper when running our end-to-end stack in debuggers.

Workstation 有 4GB 内存,在调试器中运行端到端堆栈时,我可以使用 ReSharper 轻松杀死它。

回答by MicTech

You can look how much memory ReSharper use.

您可以查看 ReSharper 使用了多少内存。

ReSharper -> General -> Show managed memory usege in status bar.

ReSharper -> 常规 -> 在状态栏中显示托管内存使用情况。

回答by Greg

If you are working on large source files, Resharper does get sluggish (I'm working on version 5.0 at the time of writing this).

如果您正在处理大型源文件,Resharper 确实会变得缓慢(在撰写本文时,我正在处理 5.0 版)。

You can view the memory usage of Resharper by clicking on Resharper options -> General -> Show memory use in status bar.

您可以通过单击 Resharper 选项 -> 常规 -> 在状态栏中显示内存使用来查看 Resharper 的内存使用情况。

When I first did this, I noticed Resharper had clocked up hundreds of megabytes of memory usage! However, the next step worked for me in (temporarily) fixing the slugishness:

当我第一次这样做时,我注意到 Resharper 已经记录了数百兆字节的内存使用量!但是,下一步对我来说(暂时)解决了缓慢问题:

Right click the memory usage, and select "Collect garbage"- this seemed to fix the slugishness for me straight away.

右键单击内存使用情况,然后选择“收集垃圾”- 这似乎立即解决了我的迟钝问题。

回答by grover

The new ReSharper 4.5 works a lot better than the previous 4.x releases. I would recommend you try that one.

新的 ReSharper 4.5 比之前的 4.x 版本运行得更好。我建议你试试那个。

回答by Richard Ev

Regarding memory hogging - I've found that my VS2008 memory footprint grows every time I close one solution and open another. This is true even if I close a solution and re-open that same solution.

关于内存占用 - 我发现每次关闭一个解决方案并打开另一个解决方案时,我的 VS2008 内存占用都会增加。即使我关闭解决方案并重新打开相同的解决方案也是如此。

回答by Alexandre Brisebois

In previous versions I had the same problem, when 4.0 came out these problems have seemed to have gone away. Now with 4.1 i do not feel the huge slow down i used to have. My IDE does not freeze up anymore.

在以前的版本中我遇到了同样的问题,当 4.0 出现时,这些问题似乎已经消失了。现在有了 4.1,我感觉不到以前的巨大减速。我的 IDE 不再冻结了。

have you tried upgrading ?

你试过升级吗?

回答by Chuck Conway

Yes, 4.5 works much better. My understanding is that 4.5 was to address the performance issues.

是的,4.5 效果更好。我的理解是 4.5 是为了解决性能问题。