How to Profile Performance for a Single Unit Test Using Visual Studio 2013 Professional

How to Profile Performance for a Single Unit Test Using Visual Studio 2013 Professional

21 May 2024 Stephan Petzl Leave a comment Tech-Help

Profiling the performance of a single unit test is a crucial step in identifying bottlenecks and optimizing your code. Visual Studio 2013 Professional edition provides tools to perform such analyses, though the process can be a bit complex. This guide will walk you through the steps necessary to profile a single unit test using Visual Studio 2013 Professional.

Step-by-Step Guide

Setting Up the Environment

  1. Launch Visual Studio (VS) and open the project that contains the automated test you want to profile.
  2. Place a breakpoint on the first line of the test that will be profiled.
  3. Debug the test by running the test in debug mode.

Using Performance Explorer

  1. Start a second instance of Visual Studio.
  2. Open Performance Explorer:
    • Navigate to Tools -> Analyze -> Windows -> Performance Explorer (Depending on your version of Visual Studio 2013, this might be under Analyze -> Windows -> Performance Explorer).
  3. In Performance Explorer, click Actions -> Attach and attach to the process named vstest.executionengine.*.
  4. Return to the first instance of Visual Studio (currently at a breakpoint) and run the test to completion.
  5. Go back to the second instance. The profiler will detect that the unit test process has exited and complete its profiling.

Alternative Approach

If the above method seems cumbersome, you can use an alternative approach:

  1. Create a console application that calls the unit test method.
  2. Set this console application as the target project for performance analysis.

This method can be simpler and avoids the need to manage two instances of Visual Studio.


Profiling unit tests can significantly enhance your application’s performance by pinpointing slow code segments. Whether you choose to use Performance Explorer or create a console application, the key is to find a method that integrates smoothly into your workflow.

For those working with mobile applications, consider leveraging Repeato, a no-code test automation tool for iOS and Android. Repeato’s intuitive test recorder and computer vision-based approach make it easy to create, run, and maintain automated tests. It provides a seamless interface for both novice and advanced testers, ensuring your applications run smoothly. Additionally, Repeato will soon support explicit web testing, making it an even more versatile tool in your testing toolkit.

For more detailed guides on test automation, visit our blog.

Like this article? there’s more where that came from!