Sunday, August 10, 2014

Ultimate Guide to Speeding Up ReSharper (and Visual Studio) - JetBrains .NET Tools Library - Confluence

Reposting for perusing again later. Love Resharper! Wish the trials lasted longer..

/hinthint JetBrains

We constantly make sure that ReSharper works fine on modern hardware and with medium- and large-size solutions without any tweaking. We believe that Visual Studio developers are working towards the same things.
By trying to speed up ReSharper on outdated hardware, you deprive yourself of great features that can speed up your development performance.
This document presents a list of performance optimizations that can be applied if you experience performance issues with Visual Studio and ReSharper. Some of the tricks presented are ReSharper-specific, whereas others will affect VS performance whether you have installed ReSharper or not.

Speeding Up ReSharper

Disable code analysis for current file

You can temporarily disable code analysis for the current file by pressingCtrl+Alt+Shift+8. Pressing the shortcut again will re-enable the analysis. You can spot the status of code analysis in the current file by the status indicator:
If you want to bind a different shortcut for this operation, look for theReSharper_EnableDaemon command.

Disable code analysis for specific files

You can tell ReSharper to skip analyzing certain files without opening them. For example, you can skip files that contain well tested algorithms and that do not change much. To do so, go to ReSharper | Options and choose Code Inspection | Settings. Click Edit Items to Skip and use the displayed dialog box to pick the files and folders to skip. You can also specify a file mask for skipping files. Most likely, you will notice that all files where you disabled code analysis with Ctrl+Alt+Shift+8 are already there. 

Turn off Solution-Wide Analysis

On very large projects, turning on Solution-Wide Analysis may cause performance degradation, particularly on less powerful hardware. If you find this analysis to be taking up too many resources, simply switch it off: right-click the SWA circle in the bottom right corner of Visual Studio and chooseAnalyze Errors in Solution or Pause Solution.
A dialog box will pop up asking whether you want to turn off SWA. Say 'Yes' and you're done.

Disable context actions

In ReSharper options, go to Code Editing | Context Actions and Code Editing | [Language] | Context Actions, and uncheck the actions that are less helpful to you.

Speed up typing

If you experience slowdown while typing, you can turn off member signatures under ReSharper | Options | IntelliSense | Completion Appearance:
If this doesn’t help, switch back to built-in Visual Studio IntelliSense underReSharper | Options | Environment | IntelliSense | General:

Disable formatting

To speed up typing, you can also disable auto-format options under ReSharper | Options | Environment | General to avoid code formatting while typing:

Speed up code templates

To speed up expanding code templates, you can turn off the Reformat andShorten qualified references options for templates that you use:
For more information on editing code templates, see this help entry.

Disable unit testing

If you don't use the ReSharper unit test runner, you can save some processing time by turning it off. Go to ReSharper | Options | Tools | Unit Testing and clear the corresponding check-box:

Disable the navigation bar

If you use the File Structure window, then you probably don't use the navigation bar on top of the editor. If so, you can disable it by unchecking the corresponding check-box in Tools | Options | Text Editor | C#.

If nothing helps

If you've tried out everything described above and the performance is still down, you can temporarily disable ReSharper and check whether it was the cause of the slowdown. To disable/enable ReSharper, go to Tools | Options | ReSharper and click Suspend/Resume.
If suspending ReSharper helps improve the performance but you still want to use it occasionally for code cleanup, formatting or analysis, you might want to have a shortcut that quickly switches ReSharper on and off. Here is how to do it:
Go to Tools | Options | Environment | Keyboard and find theReSharper_ToggleSuspended command, then press some shortcut keys and click Assign

Known Performance Problems

The following is a list of known performance problems and their corresponding solutions.

VS2010 with R# on Windows XP slowness

This known issue can be resolved by installing the Windows Automation API 3.0. For further details, see this article. Please note that this fix applies to Windows XP only – Vista and Windows 7 already have this API installed.

Performance degradation after ReSharper upgrade

If you have recently updated ReSharper and observe performance degradation with solutions that were opened with previous versions, you can attempt to speed thing up by clearing the ReSharper caches and deleting the solution .suo file.
To clear the caches, go to ReSharper | Options | Environment | General and click Clear Caches:
Performance note: the ability to store caches in the system TEMP folder may offer additional benefits, for example in cases where project contents are synchronized via Dropbox or similar means. Also, performance can be improved if your system TEMP folder is mapped to a faster storage medium, such as a high-performance SSD or a RAM disk.

Known Compatibility Problems

Other Visual Studio extensions

Major compatibility issues have been observed with the following products:
  • DevExpress CodeRush/Refactor Pro (incompatible)
  • Telerik JustCode (incompatible)
  • Whole Tomato Visual Assist
  • Productivity Power Tools
Performance degradation has been observed with the following products:
  • Some versions of the StyleCop ReSharper plug-in
  • PowerCommands for Visual Studio
There are also reports on Web Essentials contributing to low performance while editing .cshtml files. If you're affected by this problem, consider going toTools | Options | Web Essentials and setting Auto-format HTML on Enter toFalse.

Parallels Desktop for Mac

If you're running Visual Studio in a Windows virtual machine on your Mac using Parallels Desktop, ReSharper IntelliSense lists might be very slow to render.
If this occurs in your setup, consider switching from Coherence mode to Full Screen mode. For guidelines on switching between the two modes, please seethis Parallels Knowledge Base entry.

Improving Visual Studio Performance

Before starting to tweak Visual Studio settings, check that the most recent service pack and hot fixes are installed. Here is the relevant link: http://connect.microsoft.com/VisualStudio/Downloads

Speed up editor scrolling

The problem with editor scrolling arises due to hardware-accelerated editor rendering. If you experience this, try turning off the following options under Tools | Options | Environment | General:
  • Automatically adjust visual experience based on client performance
  • Use hardware graphics acceleration if available

Save time on startup

Turning off the start page and the news channel might save some time on startup. To do so, go to Tools | Options | Environment and choose to show empty environment at startup.

Clean web cache

If you work with web projects, web cache might slow down Visual Studio. To clean it, delete everything under %LOCALAPPDATA%\Microsoft\WebSiteCache.

Disable unused extensions

Go to Tools | Extension Manager, go through the list and check if you really need each of them. You can uninstall or disable the unused ones.

Unload unused projects

If you are not working on some projects, you can unload them from Visual Studio and reload them back when needed. Right-click on the project or a solution folder in the Solution Explorer and choose Unload Project or Unload Projects in Solution Folder - this will speed up both Visual Studio and ReSharper. By the way, ReSharper navigation features will work even for unloaded projects.

Disable visual XAML editor

On large projects, editing XAML files can feel slow even on good hardware. If you don't use visual XAML editor, you can partly solve the problem by disabling it.
To do so, right-click on a XAML file in the Solution Explorer and choose Open With. In the dialog box that appears, select Source Code (Text) Editor and clickSet as default.
Alternatively, go to Tools | Options | Text Editor | XAML | Miscellaneousand deselect Always open documents in full XAML view.

No comments: