ReSharper sluggishness

10,826

Solution 1

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

Solution 2

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.

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

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.

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.

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.

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.

Solution 3

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.

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.

Solution 4

You can look how much memory ReSharper use.

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

Solution 5

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

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

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:

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

Share:
10,826
devl
Author by

devl

Always learning.

Updated on October 13, 2022

Comments

  • devl
    devl over 1 year

    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?

  • devl
    devl over 15 years
    We upgraded and got even worse results. We're using Visual Studio 2008. We had to do a complete uninstall to go back to 4.0.
  • devl
    devl over 15 years
    Thanks - as you say, this is somewhat annoying given how important the on-the-fly is. Their 4.1 release seems even flakier. I would hope that a company all about clean code would be able to clean things up to run faster.
  • Richard Ev
    Richard Ev over 15 years
    I found 4.1 to be even slower (particularly on solution load) than 4.0. Have since moved back to 4.0, primarily for that reason.
  • dove
    dove over 15 years
    @richard do you close the IDE or just the solution. I'd recommend you close the IDE when changing solutions. This stems from noticing in practice rather than any theory.
  • Richard Ev
    Richard Ev over 15 years
    Normally I close the IDE, which is kind of annoying to have to do. Alternatively I turn off ReSharper.
  • Kelly
    Kelly over 13 years
    Yes definately turn off that Solution Wide processing. It's a hog.
  • Harv
    Harv over 12 years
    I think what is referred to here as on-the-fly compilation is the code analysis feature. In 6.0 this is found under the code inspection section.