系列文章目录:
- Android性能优化典范综述
- Android性能优化典范之Render Performance
- Android性能优化典范之Understanding Overdraw
- Android性能优化典范之Understanding VSYNC
- Android性能优化典范之Profile GPU Rendering
2015 年,Google 推出了关于 Android 性能优化的短视频系列 Android Performance Patterns,原播放列表在 YouTube。官方当年的配套课程介绍也记录了这个系列。

技术复核(2026-10-13):本文保留 2015 年的选题说明和观看经历。早期视频仍可用于理解渲染问题;旧工具、Google+ 入口及“16ms”说法需要按下面的版本条件阅读。
过度绘制、VSYNC、主线程与 RenderThread 的协作仍然值得学习,但帧间隔不是永远 16ms。60Hz 对应约 16.67ms,90Hz 约 11.11ms,120Hz 约 8.33ms;实际产帧截止时间还要看系统调度和 trace,不能把一个固定阈值套到所有设备与场景。
| 要调查的问题 |
今天的入口与适用条件 |
| View / Compose 的层级和属性 |
用 Layout Inspector 检查可调试应用;它也支持 Compose 重组/跳过信息,不能把层级检查等同于帧耗时测量 |
| 快速观察绘制阶段和过度绘制 |
开发者选项里的 Profile GPU/HWUI Rendering、Debug GPU Overdraw;柱形图是 CPU 侧绘制阶段信号,不是纯 GPU 执行时间,也不能覆盖所有自建渲染路径。官方说明 |
| 具体哪些帧错过期限 |
使用 Perfetto 的 FrameTimeline,要求 **Android 12 / API 31+**;再结合已采集到的线程、调度和 SurfaceFlinger 轨道定位 |
| 滑动或页面切换是否退化 |
Macrobenchmark FrameTimingMetric 从 AndroidX Benchmark 1.1.0 提供;frameOverrunMs 要求 **API 31+**,与 frameDurationCpuMs 的口径不同 |
Hierarchy Viewer、Traceview 所属的旧 Android Device Monitor已在 Android Studio 3.1 弃用、3.2 移除。方法级分析使用当前 Profiler,层级检查用 Layout Inspector。做 Macrobenchmark 时按项目配置要求使用接近发布状态的 non-debuggable、profileable 目标应用,并固定设备与操作场景。
当时的官方简介(原文摘录):
Android Performance Patterns is a collection of videos focused entirely on helping developers write faster, more performant Android Applications. On one side, it’s about peeling back the layers of the Android System, and exposing how things are working under the hood. On the other side, it’s about teaching you how the tools work, and what to look for in order to extract the right perf out of your app.
But at the end of the day, Android Performance Patterns is all giving you the right resources, at the right time to help make the fastest, smoothest, most awesome experience for your users. And that’s the whole point, right?
总之就是一系列讲解Android性能相关的视频。这些小视频的时间非常短,在3-5分钟之内,主讲人的英文语速也非常快,初期这些视频没有翻译的时候,着实考验了一把听力。当时已有中英文字幕可供参考;现在具体有哪些字幕,以各视频实际提供的轨道为准。
这些视频的时间虽然很短,但是信息量却非常大,有些他一句话带过的内容,我们却需要花费很多的时间去研究他的原理,或者研究一个调试工具如何使用。也就是说,这一系列视频并没有真正教你如何去优化你的应用,而是告诉你关于Android性能优化你需要知道的知识,这样你去优化你的Android应用的时候,知道该用什么工具,该采取什么样的步骤,需要达到什么样的目标。