Essential Tips and Tricks to Optimize Performance on Visual Studio 

Microsoft Visual Studio has long been a popular developer tool for beginners and professionals alike. From creating websites and web apps to web services and computer programs, Microsoft Visual Studio can do it all.

What makes Visual Studio so great lies in its many powerful tools and features. It’s also great for supporting multiple languages, enabling cross-platform development, and has version control integration.

For the most part, Microsoft Visual Studio is ready to go after installation but in rare cases of low memory situations, there are a few ways to optimize certain Visual Studio features that TechQuarters, a trusted IT Support London based company, would recommend if needed.

Use a 64-bit OS

For starters, the ideal way to deal with low memory-related issues is by upgrading your existing operating system. It’s not uncommon that those with a 32-bit version of Windows can have some difficulties using Visual Studio. Upgrading to a 64-bit version will expand the amount of virtual memory available so that Visual Studio has access to 4 GB instead of just 2 GB. Ultimately it will allow the platform to handle larger workloads.

Disabling Automatic File Restore

If upgrading your operating system is not an option right now or you’re still having issues with a 64-bit version, then the next thing to try would be to disable Visual Studio’s automatic file restore feature. With it enabled, Visual Studio will automatically reopen documents if they were left open from a previous session.

While this feature is great for efficiency, it can take 30% longer or more to load a solution depending on the type of project and the documents that need to be opened with it. If you’re using Windows Forms and XAML, or certain TypeScript and JavaScript files, it can be slower to open.

Configuring your Debugging Options

If you find you’re running low on memory when it comes to debugging, there are three main configuration changes that can be done that will greatly optimize your performance.  The first, and simplest, option is to enable the ‘Just My Code’ feature. If this feature is enabled, it can result in significant memory saving for managed applications debugging. It works by only loading symbols for your project. It’s often enabled by default in certain project types but if not, it’s easy to enable in your Tools tab.

Another configuration change that can be done is specifying the symbols to load. Generally for native debugging, it can drain memory resources to load symbol files. Simply configuring your debugger symbol settings to either only load modules from your project or only specified modules, can significantly conserve your memory.

The third debugging configuration is disabling your diagnostic tools. Generally, CPU profiling is a feature that can consume large amounts of resources. So, if you don’t need the provided features, it can be worth turning off when you’re done to save some resources. But it’s important to note that leading IT Support in London would only recommend disabling CPU profiling after use. Otherwise, disabling before use can affect the accuracy and completeness of the data collected by the tools.

Disabling Tools and Extensions

There are several tools and extensions that can be turned off for better performance but it’s important to turn off one at a time to better isolate any potential performance issues. The first to check, specifically for the .NET Compiler Platform “Roslyn”, is CodeLens. CodeLens will impact performance when loading large solutions and mostly works to provide features like the inline display of references.

Otherwise, a simple resource saver is to simply disable extensions one at a time. Any extension is an additional software component to provide new functionality, but they aren’t necessary to keep enabled.

Two simple tools that are enabled by default but aren’t necessarily needed are map mode and word wrap. Both help display lines of code but can both be disabled if needed. Additionally, users can remove workloads with the Visual Studio Installer that are no longer in use. This will help streamline the startup and run time by skipping the assemblies and packages that are no longer needed.

If you’re a user who wants to work with XAML files but doesn’t need the designer functionality that is enabled by default, you can disable this feature to free some extra memory.

And lastly, users can add untracked files and enable commit graphs in Git tooling. Adding untracked files to a repository when working with Git can free up extra memory. It works by telling Git to ignore files or folders instead of checking or showing them during command runs for Git status. Enabling commit graph in Git tooling on the other hand will allow you to make the history of your repository or branch load faster and show more details.

Forcing a garbage collection

The last trick you can do to improve performance for Visual Studio that top Office 365 Consulting London based providers would recommend is using a feature called garbage collection. It can help clean up storage and find the things you don’t need anymore. Garbage collection runs automatically but only when it thinks it’s necessary. 

You can alternatively force a garbage collection which can be great for checking memory usage after a big building, debugging, or opening session. If you find however that forcing a garbage collection is useful often it can indicate an issue and should be reported with the feedback tool on Visual Studio.

Ultimately, Visual Studio is rich with features and tools to make developing efficient. It has a large number of things that make it a platform worth using and one of them is the ability to customize and optimize your personal platform to best suit your individual needs. Memory issues can be a challenge to deal with, but these recommendations should help. You shouldn’t be automatically enabling, disabling, and using all these recommended tips and tricks all at once but rather one at a time to find a solution that works best. 

Interesting Related Article: “How to End-to-End Test Your Web Applications