TestMatrix: Code Profiling

TestMatrix includes easy to use code profiling features that record call traces and measure performance simultaneously as part of the unit testing process. This information will help you better understand the implications of your design choices and spot potential performance problems early. The performance profiler tells you how long each method took to execute and where it was called from.

Profile your code from within Visual Studio itself

TestMatrix performance profiling features work inside of Visual Studio, meaning you don't have to launch a separate application or turn your attention away from the code. Profiling results are displayed in simple, sortable summary reports, making it easy to spot bottle necks. TestMatrix lets you practice continuous performance testing while you code and test, unlike stand alone profiling tools that tend to get dragged out only after problems are detected.

Continuous profiling at the unit level

It is not unusual for developers to use test timings as a sort of poor-man's profiler. Considering how expensive and difficult most profilers are to use, it's a practical decision — if not always the most accurate one. TestMatrix splits the difference between this approach and expensive, stand alone code profiling applications. TestMatrix includes an easy to use performance profiler that gathers timings, total times, and call counts just like an expensive profiler, but does so automatically each time you run your tests. It's profiling from the bottom up.

Since performance tuning almost always comes down to the little things, unit level performance testing is a more precise and easier method of profiling than setting up a large external profiler. If you can make your classes and components fast at the unit level, you are well on your way to having a high performance application.

Find out what you've been missing

By including profiling feedback as part of your unit testing, you'll gain valuable insight into the relative performance of your application's components. Because each line and method reports its share of runtime, you'll find surprising results about what does and doesn't take lots of time. It's educational, and will help you build up a measured foundation of performance tuning knowledge, rather than relying on straight guessing and rules of thumb. And best of all, it's automatic as part of your testing process and not another task you must disengage from programming to perform.

Targeted performance analysis

TestMatrix is also useful for targeted performance profiling. To investigate particular performance questions you can profile any static method that doesn't require arguments, or you can simply create test cases that exercise the code in question. This is a simple, elegant alternative to writing throw-away test programs to call your code. This approach is also more convenient, because you can pack these performance tests into a separate DLL and save them, allowing you to track your performance over time. Test Explorer's category and project filters make it easy to omit any long running performance tests from your every day testing runs.

Surprising speed you'll appreciate

The TestMatrix profiler is a fast and easy way to gather performance statistics. Instrumentation happens automatically at runtime, so there's no need make any changes to your code, you don't even need to recompile. If you've used other profilers, you know they can increase the runtime as much as 700%, making them aggravatingly slow to use. TestMatrix won't slow you down as much as you'd think, you'll be surprised at just how fast it is. A typical project will experience an increase in runtime of only about a 10-15%. When working with smaller projects or individual test cases this increase goes practically unnoticed.

Profiler results panel

Performance profiling results are displayed in their own report panels that lets you browse, sort, and analyze the results of your code profiling across the entire solution. Sorting and filtering controls make it easy to focus in on suspect classes or methods. Click on any method or class to navigate to it in the editor.

Export results as XML

You can export your application's coverage information in XML format. This makes it easy to generate coverage reports, track progress over time, and collect other metrics. From the Coverage Profiler's file menu, just select Export as XML.