1、 检测函数的执行时间(Performance profiling an application)
这个功能很容易使用,关于Exe文件如何测试,ANTS Profiler自带的例子有详细的说明,我这里主要关注Web程序的执行。Red Gate公司费了很大的心思把这个向导作的相当完善,如此的简单,根本就不需要任何帮助就可以顺利完成您的测试操作。您需要提供一个程序运行的Url,然后next就可以了,因为这个东西是完全本地的,所以程序的Url可以是http://localhost/TestProject/index.aspx 而且因为是本地的,所以才可以看到原代码,我不清楚后台是否使用了反射去搜索原代码了。
2、 检查内存的分配情况 (Memory profiling an application)
要使用这个功能,我还想了1天,怎么在结果中没有看到关于内存的使用情况呢?以为是在一次执行的时候,既可以把函数的执行时间纪录下来也可以把内存的分配情况也纪录下来。后来看了看帮助文件profiler.chm,才发现是需要两次执行的。如图所示:
另外,提一点不错的东西
在向导的最后一步,还可以选择Profile什么方法?(仅限于检测函数的执行时间)
提供三种类型的Profile,
l 默认是“Only .NET methods that have source code”:Select Only .NET methods that have source code to profile only those methods in your application that have been compiled with debug information.
l 第二种是Select All .NET methods to profile all the methods used by your application, including those from .NET Framework assemblies.
最灵活的是第三种You will normally only need to select this option if you are interested in performance problems across all of the .NET Framework.你可以自己定义自己需要检测的代码的NameSpace或者Class,只需要在输入您的类名就可以。
浙公网安备 33010602011771号