web developer tips (60):如何对ASP.Net网站进行性能分析

原文地址:How to Profile an ASP.Net site?

1、使用Visual Studio Team Edition For Developers 创建一个Asp.netweb应用程序。

http://www.watch-life.net/visual-studio/profiling-an-asp-net-site.html

2、在Page_Load方法里写如下代码



protected void Page_Load(objectsender, EventArgs e) 

{ 

    int sum
= 0; 

    for(int i
= 0; i < 2000000; i++) 

    { 

        sum += i; 

    } 

    Response.Write(sum); 

}

 

3、启动性能向导
image

4、选择当前应用,点击“下一步”
image

5、选择“采样”,点击“下一步”
image

6、单击“完成”.

7、在“性能资源管理器”中,选中“启动并启用分析功能”
image

8、将会启动IE,执行完后关闭IE。

9、vs将会性能分析报告摘要。
image

有关性能分析工具参见MSDN:
英文版:Getting Started with Profiling Tools
中文版:分析工具入门

更多文章见:守望轩[http://www.watch-life.net/]

posted on 2009-11-06 09:14  xjb  阅读(444)  评论(0编辑  收藏  举报

导航