开发者

.NET micro-benchmarking API [closed]

开发者 https://www.devze.com 2023-03-13 22:30 出处:网络
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 5 years ago.

I开发者_如何学Pythonmprove this question

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消