WP7 App性能优化(9):检测应用程序性能(Ⅱ)

启用帧频计数器

Windows Phone 模拟器提供了帧频计数器以便于在开发时监测应用程序的性能。要启用帧频计数器,请设置P:System.Windows.Interop.Settings.EnableFrameRateCounter属性为true。该属性也可以通过当前应用程序设置来访问,如下代码所示。

Application.Current.Host.Settings.EnableFrameRateCounter = true;

注意:要看到帧频计数器,你可能需要将SystemTray.IsVisible属性设置为false.

以下示意图展示的便是帧频计数器。

Ff967560.ad000fc8-6d81-4290-9afa-5e03cfd078ca(en-us,VS.92).png

下面的表格描述了每一个计数器的作用。

计数器

描述

Composition Thread Frame Rate

该值指示屏幕的更新速率。也可以表示storyboard驱动的动画所支持的更新速率。该值应尽量接近60.当该值小于30时应用程序性能将会降低。当数值小于30时,计数器文本将显示为红色。

UI Thread Frame Rate

该值指示UI线程运行的速率。UI线程控制着输入、逐帧回调和其他非构图线程处理的绘制。这个值越大,应用程序的响应性越高。要保证一个可接受的用户输入相应时间,该值一般应在20以上。当该值小于30时其文本会显示为红色。

Texture Memory Usage

该值表示应用程序使用的纹理层拷贝需要的视频内存和系统内存。这不是应用程序的通用内存计数器,而仅仅是被表面显示层使用的内存。

Surface Counter

该值表示传递给GPU处理的原始表层数目。该数字的最大来源是自动、或由开发者缓存的元素。

Intermediate Surface Counter

该值表示生成为缓存表层结果的确切的表层数。这些表层由UI元素创建,因而应用程序可以在UI中精确地保持其Z轴顺序。

Fill Rate Counter

该值表示屏幕上每一帧绘制的像素数。数值1表示480*800像素。推荐值是2.5。当值大于3时其文本会显示为红色。

 

补充:

关于帧频计数器,Jeff Wilcox的博文《Frame rate counters in Windows Phone》也进行了很详细的介绍。以下片段摘自这这篇文章供参考。

NewerCounters

Target frame rates for good performance

When testing on a Windows Phone device, here are key performance metrics to try for. Understand that the emulator (XDE) performance may not be indicative of actual device performance.

Frame rate counters may be 0 when there is no animation being updated on the thread at any particular moment. You can add a very simple, continually animating and repeating, animation to your application during development & testing if you want to ensure that there is always some frame rate value available.

CounterIdeal MinimumBest ExperienceTheoretical Max
Render Thread30 fps60 fps120 fps
UI Thread15 fps> 15 fps120 fps
Screen Fill Rate1.0<= 2.0N/A

 

转到:WP7 App性能优化(0):索引页 

转载于:https://www.cnblogs.com/magicboy110/archive/2010/12/26/1917262.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值