I love the ReSharper features but when I installed it onto my project on my laptop VS2010 is running a lot (read unusable) slower:
Stats are
Windows 7
4GB RAM
Intel 2 Core Duo # 2.00GHz
VS 2010
ReSharper 6.1
32 Bit Architecture
I'm assuming this should be enough to run the program so possible reasons I can think of are
other plugins causing conflicts / overloading VS
too many ReSharper errors (it's old code so will need cleaning)
Does anyone else have suggestions as to what this could be?
EDIT: the solution is 15 separate projects with 20 - 30 cs files. Some are very large (antlr generated)
EDIT: After turning off the 'solution wide analyse feature' the memory usage is down to 500Mb and it's running fine.
I sometimes need to open old projects where there are many big files with resharper errors.
My solution is to exclude these files from the resharper analysis ("Edit items to skip" under the Code inspection settings).
I lose some intellisense but VS becomes usable again. If I need to do a lot of work in one of these big files I enable them one by one.
ReSharper tends to bloat memory usage of Visual Studio (check devenv.exe under the Processes tab in Task Manager). If you have a solution containing many projects, and are running lots of other things on your PC you may find that memory is being swapped to disk a lot.
Possible solutions:
Get more RAM
Run fewer programs at once
For me I was using Resharper with Visual Studio 2013 with 30+ projects, and even disabling solution-wide analysis in addition to Ultimate Guide were not good enough in total. I have 16GB RAM - so memory was probably not the issue.
Resharper does not scale up that well with increasing number of projects.
How I fixed those issues were (in addition to the Ultimate Guide (suggestions there are great))
Unload any projects that are not directly related
Edit items to skip as Adrianm suggested
Go to Resharper Menu => Options => CodeInspection => Inspection Severity. Go to your programming language (C# for me). Among the options there you will see many inspection severities for different issues (a few hundreds). Most of them I did not care, some of them I used very frequently. I set the severity to "Do not show" for many of the severities that I did not care.
Since Resharper also had reduced performance after a while, and I really had some suo settings that I liked in my solution (some less frequent projects unloaded, debug exceptions enabled etc.), I took a backup of them. First delete the suo file (user settings) in the solution folder. After that set the settings you want in Visual studio, and click save all. After that take a backup for that suo file. Every time resharper slows, if suspend/resume does not help, I close the solution, delete the current suo file, restore the suo file from the backup and start the solution back again.
All those steps now are providing me a very good pleasant Resharper performance with my Visual studio. It helps to invest as early as you can. Especially for item 3 when you think about it you are actually running many checks in parallel that you do not care about.
I know this is an older thread - yet the portions I wrote here are kind of independent from Visual Studio and Resharper version and I could not find this anywhere else on the web.
Hope it helps to anyone seeing similar performance issues with Resharper.
Edit 1: Btw - once you have that working it helps to get a backup of the resharper settings in case they get lost. If you are sharing the project among multiple developers, putting it to git/SVN might be a good idea as well.
Related
I have installed Visual Studio 2015 Professional Edition, and my computer specs are Intel i7-3770 CPU 3.40 GHz, 8 GB RAM, and Windows 7 Enterprise 64-bit.
I want to upgrade my project to .NET 4.6 which is written in Visual studio 2005 .NET 2.0, but I have a serious problem about speed. After I open my project (huge project) in Visual Studio 2015 it is going crazy. Building, debugging, opening menus are too slow. Sometimes I got "not responding" message. Is it about Windows 7 or can you give me any advice about my speed problem?
You can try to apply the following steps:
Go to menu Tools → Options → Source Control and set Current source control … to None
Go to menu Tools → Options → Environment (or Accounts) → Synchronized Settings and remove this option by unchecking the checkbox.
Clean the contents in the following cache folders (do not delete these folders, instead delete their contents only) and restart Visual Studio:
Clean the content in WebSiteCache folder (can be found in C:\Users%USERNAME%\AppData\Local\Microsoft\WebSiteCache)
Clean the content in Temporary ASP.NET Files folder (can be found in C:\Users%USERNAME%\AppData\Local\Temp\Temporary ASP.NET Files)
Note: If you have Hardware Acceleration enabled or if you use the default Visual experience settings in Microsoft Visual Studio 2015 or Visual Studio 2013, you might experience intermittent performance issues, product crashes, or rendering issues. In order to work around these issues, go to menu Tools → Options → Environment → General and apply the following settings:
For more information, visit You experience performance issues, product crashes, or rendering issues in Visual Studio 2015 and Visual Studio 2013.
If the problem is related to debugging, try the workaround on Visual Studio debugging/loading very slow.
This site contains some useful tips on how to improve the Visual Studio performance, disabling features for large solutions. For example:
Go to Tools -> Options -> Text Editor -> C# -> Advanced and uncheck Enable full solution analysis
Go to Tools -> Options -> XAML Designer -> General and uncheck Enable XAML Designer (requires restart of Visual Studio)
Go to Tools -> Options -> Text Editor -> All Languages and uncheck Enable CodeLens
Go to Tools -> Options -> Debugging -> General and disable Enable Diagnostic Tools while debugging
I have a large project and have experienced these kinds of slow downs too. I've improved the performance to an acceptable level by changing the scope of the Error List window to Current Document.
I also get improvements by changing from Build + IntelliSense to Build Only. But because I find the IntelliSense useful, I compromised to keeping Build + IntelliSense and scoping to Current Document.
I have found that removing the ".vs" folder from your solution folder greatly increases editor speed if it becomes slow over time. It is a hidden folder in the root directory of your solution. I would recommend saving a backup of it just in case you need to revert. As far as I know, it holds user specific settings for the solution such as the .suo file as detailed here. You can try just removing the .suo file too. These folders/files will be regenerated by VS the next time you open and close that solution.
The Windows Defender Antimalware can cause Visual Studio to lag. As mentioned by Nostradamus in this answer:
Go to Update & Security -> Settings -> Windows Defender. Open the Defender and in the Settings selection, choose Exclusions and add the "devenv.exe' process.
Another thing I did was update ReSharper and every addon to the latest update.
I also noted that several processes called Microsoft Compatibility Telemetry, CompatTelRunner.exe was using a lot of CPU when I used Visual Studio. I disabled "Feedback and diagnostics" by following this guide.
It worked for me!
Is it possible that you were trying to do different operations on solution at the same time? In my situation, the problem appeared because I was trying to open solution, while there was a process from TFS, which was trying to get latest version. Some kind of lock happened.
Safest way I thought of was to restart the system, delete .suo file and it worked for me.
What else: check if your visual studio version is 64bit on 64bit system, I have uninstalled some team foundation power tools and it screwed with my VS, it produced the same problems
Make sure you're not working on a solution that's on a network drive.
Seems like such an obvious thing, but I missed it, and VS gives you precisely no hints as to the problem, it's just lots of "Not Responding...".
For me the culprit was Resharper cache, simply clear Resharper cache and it works fine
I suggest the quickest and easier performance enhancement (for C#) is to replace VS 2015/2017 with VS2013.
C# is largely unchanged between versions. It just takes twice as long to use 2015/2017 and I am sure I am not the only one to waste time using later (better)compilers only to have to revert.
I do not think it is unreasonable to expect to use a compiler straight out of the box. You can with 2013.
Microsoft MUST ensure VS2019 is at least as fast as 2013 (for C#)
I've downloaded VS2015 for desktop for personal use. However, the IDE is incredibly slow, I have to wait for around 3 secs to type. I can't even rename a folder. When I have VS open, it's really slow to browse the internet as well.
I believe my system meets all the system requirements, based on this link.
My system is running on:
Win8 Pro (Dual Boot, installed in Macbook Pro)
8 GB of RAM
i5 #2.30GHz
300GB HDD
I've done the ff TS, based on my research but none of them works:
change the source control from TFS to none (since I dont use one anyway).
remove the git DLL files that has something to do with Git.
uncheck automatically adjust visual experience based on client performance.
uncheck auto updates.
downgrade to VS2012, issue still persist.
sent a feedback to Microsoft VS but I havent receive any.
Im not familiar with Resharper or NTVS yet so most likely I haven't installed them. Ive check in the control panel its not there.
Is there anything else I can do to rectify the issue?
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:
Disabling CodeLens
Uninstalling ReSharper
Disabling the four C# Intellisense features found in Tools->Options
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."
We have a relatively large solution file (25 projects). If I build any one of these projects, the final build step is "Transforming templates for all project items". Does anyone know where the setting is to toggle this functionality in visual studio 2012.
I thought it was my 'power commands' plugin which was doing this, but I've turned it off but doing so hasn't stopped the functionality.
It causes all the builds to hang for 5 - 6 seconds at the end, and for something that isn't really needed for each and every build its getting a bit annoying.
--Edit
I got frustrated and removed a bunch of add-ins from my VS but no luck.
These were:
VS Power Commands
VS productivity tools
Tangible T4 Editor (free)
Strange thing is, in one branch it doesn't do it and in others it does, even after a full merge. I tried deleting the .suo file but it made no difference.
There are a lot off ways this can be done but did you look at msdn
I've a very large project and now work with an custom solution to handle the generation I use unit test and T4Host
IDE Configuration:
Visual Studio 2008 + Resharper 4.5.1 + Agent Smith 1.1.8.
There is no any sophisticated configuration for last to add-ins.
Solution description:
33 class libraries + web site with 200+ pages.
Symptoms: After an hour of work under tuned on Resharper the IDE starts to throw the OutOfMemoryExection exceptions. Normal work is impossible only reopen Visual Studio can help.
Does anybody has such problem? Is it possible to configure Resharper to consume less memory? What Resharper feature does consume the most memory?
Welcome to the World of ReSharper. This lesson is called, "You get what you pay for".
Various features of ReSharper do require knowledge of your entire solution. This information takes memory. The solution-wide analysis may be the most memory-intensive, but even changing the signature of a public method requires knowing all the code that calls that method.
One thing you can do sometimes is to use smaller, "sub-solutions". If you are refactoring your DAL layer for instance, you only need the DAL and any unit test projects. What I sometimes do is to select the solution in Solution Explorer and use File->Save Solution As to save it with a different name in the same folder. I then remove projects until I'm left with those I want. Do not save the projects you're removing (save them before you start). When you've got the set you want, just do a Save All.
If it becomes too much of an annoyance, you can also get ReSharper to display the memory usage in the status bar. That feature has been available for a long time.
If you're on 64-bit Windows (or you're happy to run 32-bit Windows with the /3GB switch), then you can configure Visual Studio to be /LARGEADDRESSAWARE, which, rather than 2GB, will give it 4GB (or 3GB on /3GB) of address space to play with.
See, for example, http://old.stevenharman.net/blog/archive/2008/04/29/hacking-visual-studio-to-use-more-than-2gigabytes-of-memory.aspx, which gives the following:
editbin /LARGEADDRESSAWARE devenv.exe
Also, see the JetBrains page on the topic: http://www.jetbrains.net/confluence/display/ReSharper/OutOfMemoryException%2BFix
I have seen this and similar problems in the past with earlier versions of Resharper (and other similar add-ins) and large solutions, and is one of the reasons I try to stay away from them. The only solutions I know of were to restart Visual Studio, uninstall Resharper, or keep it turned off except for when you really need to use it.
For what it's worth, Visual Studio 2010 should help with these types of problems.