Skip to content

Instantly share code, notes, and snippets.

View FObermaier's full-sized avatar
🇺🇦
Solidarity with Ukraine

Felix Obermaier FObermaier

🇺🇦
Solidarity with Ukraine
View GitHub Profile
@andykuszyk
andykuszyk / Performance profiling NUnit tests using Visual Studio 2015.md
Last active July 1, 2025 07:52
Performance Profiling NUnit tests using Visual Studio 2015

Performance Profiling NUnit using Visual Studio 2015

Shortly after learning about the great performance profiling tools built into Visual Studio 2015 (we've just upgraded from 2010, when the best free solution was to use SlimTune [which is awesome for a free, unsupported, open-source tool, but not as awesome as the tools in VS 2015]), I wanted to be able to performance profile slow running unit tests.

Previously, using the afore mentioned SlimTune (https://code.google.com/archive/p/slimtune/), I would run the NUnit gui runner and run the test I was interested in. Although this is still an option using the new VS tools, it doesn't give you a very accurate picture of what's taking the time and, importantly, results in the "hot path" analysis not being useful.

As such, I followed these simple steps to profile my first few tests.

1. Prepare the test for profiling

Nothing special here, I just marked the test for profiling with a unique category so I could pull it out and run it independently from the com