How-To's

Performance Guide for Visual Studio in ReSharper 2017.3

Visual Studio is an application which services many developers across Windows, the Web and multiple Cloud and Mobile platforms. ReSharper is an application with a powerful semantic model of 10+ programming languages and thousands of features. Integrating one into the other is an insanely complex affair that sometimes creates problems for the end user.

We’ve consistently received feedback on Visual Studio being slow with ReSharper and are fixing reproducible issues to improve how ReSharper impacts the performance of Visual Studio. When we find an issue that is beyond ReSharper, we do report those issues to Microsoft, but we have little control over the way Microsoft addresses these issues.

As a result of an extensive experience interacting with users and helping them find workarounds to performance issues, we have developed a Speeding up ReSharper and Visual Studio help article which collects and prioritizes known performance improvement recipes.

However, it’s one thing to provide documentation that you’re not guaranteed to even discover, and a totally different thing to provide performance improvement recipes right in the product. Realizing this made us develop an actual ReSharper feature called Performance Guide that is now available in ReSharper 2017.3 EAP.

The Performance Guide collects some of the settings, both Visual Studio’s and ReSharper’s, that have a track record of deteriorating the performance of Visual Studio with ReSharper. In addition to collecting these settings (which are normally located throughout Visual Studio’s own options) into one place, ReSharper provides a quick way to change them, and lets you choose a strategy of handling settings with a possible performance impact.

Right now, ReSharper’s bundled Performance Guide automates only a fraction of recipes provided in the help article, and we hope to automate more of them going forward.

Download ReSharper 2017.3 EAP to experience the new Performance Guide.

How it works

The new Performance Guide can be found in the ReSharper options, under Environment | Performance Guide. The guide is broken down into two areas: those options dealing with performance in Visual Studio (which have been collected into a single area for users), and the options for ReSharper which affect performance.
ReSharper Performance Guide

Each option has a setting which will allow the user to determine how they want the option to be executed and presented. There are three settings in the dropdown list from which the user can select.
Choosing a strategy for a specific option

  • Ignore will have ReSharper skip changing the option during startup of Visual Studio or when a solution is loaded.
  • Show in Status Bar will let ReSharper warn the user about settings that can be changed to improve performance. ReSharper will display the warning in the Notification widget and also in the status bar after a solution has been loaded in Visual Studio.
  • Fix Silently will allow ReSharper to perform performance tuning during Visual Studio startup and when a solution is loaded, without notifying the user through the Notification window or on the status bar.

Notification widget
Status Bar notification

Visual Studio performance options

There are a number of performance affecting options throughout Visual Studio which have been identified and collected for the user. With each option, the Performance Guide identifies the specific setting path where the option is located in Visual Studio’s Options dialog, displays the current setting of the option and lists a recommended setting for the best performance of the IDE.

To change an option for Visual Studio, click Open Options and Visual Studio’s Options dialog box will appear.
XAML Designer is enabled in in Visual Studio options

In the interest of time, we will not go through all the options, but will look at a few of them.

The Disable XAML designer option can help improve XAML editor responsiveness and offers substantial improvement in memory usage. The option is enabled by default to load the visual XAML designer but disabling the visual designer will help with Visual Studio performance and memory consumption. Try it out and see if Visual Studio has a better experience when editing.

Also a note that ReSharper has a set of tools that assist developers with XAML that includes code quality analysis on-the-fly, refactorings, code generation and rearrangement, as well as quick solution-wide navigation. Learn more about ReSharper’s XAML tools here.
Disabling XAML Designer in Visual Studio options

Using Visual Studio’s CodeLens mechanism is also known to introduce performance issues in many cases. This is OK if the user is enjoying it but if they’re not, they will probably benefit in overall IDE responsiveness by turning it off. ReSharper will suspect potential performance issues (and, depending on your preferences, notify) if any items are selected under the umbrella Enable CodeLens option.
Enable or disable CodeLens in Visual Studio settings

ReSharper performance options

As of this moment, there is only a single ReSharper performance option available which the user can adjust. This option allows the user to have the Roslyn lightbulb items merge with ReSharper’s lightbulb instead of displaying them in separate menus.

When opening this option, the user will be brought to Code Inspection | Settings and the area will be highlighted to show or not show Roslyn’s lightbulb in ReSharper’s lightbulb.
Visual Studio integration settings in ReSharper

Wrap up

If you are using ReSharper in Visual Studio but you are not happy with the performance of the duo, download ReSharper Ultimate 2017.3 EAP and try letting ReSharper do the dirty IDE performance tuning work. Does it help? Let us know.

image description