本文介绍了Logcat 中 Choreographer 消息的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了最新版本的 SDK (API 16) 并获得了最新的 ADT.我现在在 logcat 中看到这些消息,我很确定,我以前从未见过.有人对此有什么想法吗?

I installed the latest versions of SDK (API 16) and got the latest ADT. I'm now seeing these messages in the logcat, that I'm quite sure, I haven't seen before. Does anyone have an idea about this?

06-29 23:11:17.796:I/Choreographer(691):跳过了 647 帧!这应用程序可能在其主线程上做了太多工作.

我搜索了一下,找到了这个链接:http://developer.android.com/reference/android/view/Choreographer.html.这是 API 16 中引入的新类.

I did a search and found this link:http://developer.android.com/reference/android/view/Choreographer.html. This is a new class introduced in API 16.

我需要知道如何确定我的应用程序可能在做什么太多工作",因为我的所有处理都是在 AsyncTask s 中完成的.

I need to know how I can determine what "too much work" my application may be doing as all my processing is done in AsyncTasks.

推荐答案

Choreographer 可让应用将自身连接到 vsync,并正确安排时间以提高性能.

Choreographer lets apps to connect themselves to the vsync, and properly time things to improve performance.

Android 视图动画在内部使用 Choreographer 来实现相同的目的:正确计时动画并可能提高性能.

Android view animations internally uses Choreographer for the same purpose: to properly time the animations and possibly improve performance.

由于 Choreographer 被告知每个 vsync 事件,它可以判断 Choreographer.post* apis 传递的其中一个 Runnables 是否没有在一帧的时间内完成,导致跳过帧.

Since Choreographer is told about every vsync events, it can tell if one of the Runnables passed along by the Choreographer.post* apis doesn't finish in one frame's time, causing frames to be skipped.

据我了解,Choreographer 只能检测跳帧.它无法说明为什么会发生这种情况.

In my understanding Choreographer can only detect the frame skipping. It has no way of telling why this happens.

消息应用程序可能在其主线程上做了太多工作."可能会产生误导.

The message "The application may be doing too much work on its main thread." could be misleading.

这篇关于Logcat 中 Choreographer 消息的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-20 12:30