Android 跟踪视图
在提出这个问题之前,我已经看到了以下链接
如何在中使用traceview用于 android 开发的 eclipse?
http://developer.android.com/guide/developing/tools/traceview.html< /a>
http://developer.android.com/guide/developing/debugging/debugging-tracing.html
现在我能够生成跟踪并进行方法分析。
但我仍然不清楚如何读取跟踪并使我的代码高效。我的应用程序运行得很慢。请指导我
请参阅时间线面板和配置文件面板的图像
Before putting this question i have seen following links
how to use traceview in eclipse for android development?
http://developer.android.com/guide/developing/tools/traceview.html
http://developer.android.com/guide/developing/debugging/debugging-tracing.html
Now i am able to generate trace and do method profiling.
But it is still not clear to me how to read the trace and make my code efficient.My application is working so slow.Please guide me
Please see the images also of timeline panel and profile panel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您正在模拟器内运行该应用程序。应该提到的是,模拟器比实际设备慢得多。
不幸的是,图像不是高分辨率,我看不到细节,但主线程看起来很好,没有任何很长的调用。
在执行分析任务时,我通常会查找怀疑会降低性能的位置,并在这些位置周围放置 Debug.startMethodTracing() 和 Debug.stopMethodTracing() 。例如,如果某个 Activity 非常慢,则将其放置在该 Activity 的 OnStart() / OnStop() 中。
之后,只需使用
Find:
Traceview 行查找您的包类并确定性能瓶颈。Looks like You're running the app inside emulator. It should be mentioned that emulator is much slower than actual devices.
Unfortunately, images is not hi-res and I cannot see details, but main thread looks fine without any very long calls.
While doing profiling task I usually look for places suspected to slow down the performance and place
Debug.startMethodTracing()
andDebug.stopMethodTracing()
around that places. E.g. if some Activity is very slow, then place it in OnStart() / OnStop() of the activity.After that, just use
Find:
traceview line to find Your package class and determine performance bottlenecks.