gpt4 book ai didi

android - Android 应用程序中的 FPS 测试

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:08:18 25 4
gpt4 key购买 nike

Android 应用程序开发人员如何测试其应用程序的 FPS(每秒帧数)?我说的是一般应用,不是游戏。

它可以在模拟器或手机上。

我一直在寻找这个,但没有找到方法。如果任何开发人员都可以阐明这一点,那就太好了。

最佳答案

正如 Guykun 和 kcoppock 所提到的,如果您只使用 View 小部件或 Canvas ,您通常不会寻找 FPS 来确定视觉性能。

除了“不是游戏”之外,您没有提及自己在做什么,因此您可能想回顾一下 Android 是如何绘图的。

http://developer.android.com/guide/topics/graphics/2d-graphics.html

大部分性能问题都来自于在 UI 线程上执行操作。使用严格模式查找问题。

http://android-developers.blogspot.com/2010/12/new-gingerbread-api-strictmode.html

还可以使用工具查找性能热点:

https://developer.android.com/topic/performance

https://developer.android.com/topic/performance/rendering/inspect-gpu-rendering

https://developer.android.com/topic/performance/rendering/optimizing-view-hierarchies

如果您想了解更多关于引擎盖下发生的事情的详细信息,请参阅 Google IO session ,了解他们为硬件加速渲染所做的工作

Google I/O 2011: Accelerated Android Rendering

Google 在 UI 性能方面做了额外的工作,并在 Youtube 上提供了在 Google IO 上提供的 session :

Google I/O 2012 - For Butter or Worse: Smoothing Out Performance in Android UIs

Google I/O 2013 - Android Graphics Performance

Android performance: UI (Google I/O '17)

Drawn out: How Android renders (Google I/O '18)

关于android - Android 应用程序中的 FPS 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10983486/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com