WPF性能调试系列文章:html
WPF页面渲染优化:Application Timelineweb
WPF页面业务加载优化:Ants Performance Profiler 工具
WPF内存优化:Ants Memory Profiler性能
Ants Performance Profiler优化
Ant Performance Profiler是RedGate旗下强大的性能调优产品, 能够用于分析.NET Winform、webform以及Windows服务。使用在这里主要用来监测wpf 应用程序业务端执行所消耗的时间及性能影响。spa
下载安装Ants Performance Profiler调试
从RedGate官网下载,下载地址为http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/orm
模拟分析应用程序htm
打开Ants Performance Profiler,经过菜单File -> New Profiling Session...(Ctrl+N)打开新的监测会话,在可监测程序类型中选择.Net executable。blog
Profiling Mode:设置对于应用程序监测的方式
Line-level and method-level timings; all methods inc. framework:最详细代码级监控,包含framework内部的代码。
Method-level timings; all methods inc. framework:较为详细方法级监控,包含framework内部的代码。
Line-level and method-level timings; only methods with source:通常代码级监控,只包含项目内代码的监控。
Method-level timings; only methods with source:较少方法级监控,指包含项目内代码的监控。
Sample method-level timings:实例级监控。
开始执行后,wpf应用会打开执行,当须要检测的页面加载完成后能够关闭wpf应用,等待分析结果会显示以下图:
注:此工具针对的是页面逻辑的监控,对于xaml加载的监测可经过Application Timeline
业务逻辑代码级分析结果
查看代码执行时间就能够分析出业务代码的瓶颈,对于高请求和高耗时的代码进行具体优化。
上面是RedGate的performance profiler的使用方法,主要用于检测页面业务逻辑性能瓶颈。接下来会介绍到RedGate另外一个神级产品MemoryProfiler内存性能检测工具。