简体   繁体   English

android traceview

[英]android traceview

I made an application and I wanted to see if I can improve performance by running a traceview on a certain activity + it's background tasks. 我制作了一个应用程序,我想看看是否可以通过在特定活动及其后台任务上运行traceview来提高性能。

This link points to an image from traceview. 该链接指向 traceview中的图像。 As you can see there are 2 colors that are taking the most time + processor. 如您所见,有2种颜色占用最多的时间+处理器。

  • The blue color is from drawBitmap . 蓝色来自drawBitmap (I use a header logo, a repeating header background and another background that repeats over the whole screen, all described in XML layout file). (我使用标题徽标,重复的标题背景以及在整个屏幕上重复的另一个背景,所有这些都在XML布局文件中进行了描述)。
  • The green color is something called dalvik/system/VMDebug.startGC ()V 绿色是所谓的dalvik/system/VMDebug.startGC ()V

My questions: 我的问题:

  1. Can I do something to make this drawBitmap less expensive ? 我可以做些什么使该drawBitmap便宜些吗? (I would however like to keep all images on the screen) (但是我想将所有图像保留在屏幕上)
  2. What is this VMDebug thing? VMDebug是什么? Can't seem to find much about it via Google 似乎无法通过Google找到太多相关信息

It sounds like you may be able to optimize your bitmap drawing,(you mention a background that is drawn repeatedly) 听起来您也许可以优化位图绘制(您提到重复绘制的背景)

VMDebug is the dalvik debug monitor the startGC() function is called to start garbage collection VMDebug是dalvik调试监视器,调用startGC()函数启动垃圾回收

1) Try this answer to make drawBitmap less expensive 1) 尝试使用此答案以使drawBitmap更加便宜

2)VM-specific debug features. 2)特定于VM的调试功能。 Though this class and many of its members are public, this class is meant to be wrapped in a more friendly way for use by application developers. 尽管该类及其许多成员是公共的,但应以更友好的方式包装此类,以供应用程序开发人员使用。 On the Android platform, the recommended way to access this functionality is through the class android.os.Debug. 在Android平台上,推荐的访问此功能的方法是通过android.os.Debug类。

More Details 更多细节

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM