What's the best way to benchmark programs in Windows?

后端 未结 6 1718
我寻月下人不归
我寻月下人不归 2020-12-09 06:54

I need to do some performance benchmarks on .NET programs (C#) in Windows, but I haven\'t done benchmarking much in the Windows world. I\'ve looked into using the Windows 2

6条回答
  •  长情又很酷
    2020-12-09 07:11

    For micro-benchmarking I really like MeasureIt (can be downloaded from http://msdn.microsoft.com/en-us/magazine/cc500596.aspx). It is a test project written by Vance Morrison a Performance Architect on the CLR. It currently has a good set of benchmarks for a number of .Net/CLR core methods. The best part of it is that it is trivial to tweak and add new benchmarks for whatever you would like to test. Simply run "MeasureIt /edit" and it will launch VS with the project for itself so that you can view how those benchmarks are written and add new ones in a similar fashion if you like.

    As already been stated StopWatch is probably the easiest way to do this and MeasureIt uses StopWatch underneath for its timings but it also does some other things like running a block of code X times and then providing you stats for the runs and what not.

提交回复
热议问题