I'm looking for a library for doing micro-benchmarking of unit tests to monitor how code changes impact performance over time. That is, I would like the library to output results to e.g. XML to preserve history. It must be able to do this without any human assistant (i.e. run continously on our build server without too much hassle).
The library should be very simple and work on existing unit tests. Preferably I want to mark a test with a [Benchmark]
attribute on the test I want to test or using a using
-block, e.g.
using (var benchmarker = new Benchmarker())
{
// Code to profile
} // Dispose() stores measurements.
Note that I'm not interrested in profiling tools as I programatically wan't to specify what parts of the code I want to profile. The library should be actively maintained.
I've had a look at Jon Skeet's solution, but found it to be a bit too intrusive and NTime which has been dead for a few years.
You can use Performance Profiler on unit tests, and save the results. Make your changes, and reprofile. There are more complex ways of doing it, but adding a new workflow is not always the best option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With