Mobile Development 6 min read

Smoothness Monitoring Practices in Baidu App: Concepts, Industry Solutions, and Implementation

To ensure user delight beyond basic stability, Baidu App adopts end‑to‑end smoothness monitoring that measures frame‑rate, frame length, and dropped frames using VSync‑based Choreographer callbacks, Looper timestamps, and selective stack sampling, while balancing visual richness on diverse devices and interpreting metrics across varied usage scenarios.

Baidu App Technology
Baidu App Technology
Baidu App Technology
Smoothness Monitoring Practices in Baidu App: Concepts, Industry Solutions, and Implementation

The article introduces a series of posts on smoothness (frame‑rate) testing, a deep area of client‑side performance testing, and presents Baidu App's end‑to‑end quality monitoring practice.

Why focus on smoothness? Frequent crashes, blank pages, and noticeable stutters lead to user complaints and uninstallations. After stabilizing basic reliability, the next target is the user’s “delight” experience, where stutter (卡顿) becomes a critical issue. High‑end phones enable rich animations, but on low‑end devices these can cause performance burdens, so a robust smoothness monitoring standard is needed to balance visual effects and responsiveness.

1. Basic Smoothness Concepts

1.1 Ideal frame rate: 60 FPS, limited by a 60 Hz display refresh.

1.2 Ideal frame length: 1/60 ≈ 16.6 ms.

1.3 VSync mechanism: VSync acts as a periodic interrupt; the system emits a VSync pulse each time a new frame should be drawn, prompting the CPU/GPU to render.

2. Industry Monitoring Solutions (Android)

Various approaches are surveyed, illustrated with diagrams (images omitted). The article then details Baidu’s own monitoring implementation.

3. Monitoring Implementation Principles

3.1 Frame‑length statistics based on VSync: Using the Choreographer class, which receives VSync signals and sequentially processes Input, Animation, and Draw. By registering a custom callback’s doFrame , one can count frames per second (SM), measure frame duration (time between two doFrame calls), and detect dropped frames (SF) when a draw operation does not complete before the next VSync.

3.2 Looper‑based method: Capture timestamps from the UI thread’s Looper logs to compute frame length. Similar to the VSync approach but may lose data if the UI thread is heavily blocked.

3.3 Stack monitoring: A dedicated thread periodically captures stack traces when frame length exceeds a threshold. However, continuous stack sampling can degrade app performance and is unsuitable for long‑term production use.

3.4 Practical monitoring tips: In idle or web‑view scenarios, SM may drop to ~30 while SF and frame length can exceed ideal values, even though the UI appears static. Background downloads or off‑screen animations can affect metrics without visible stutter. Therefore, monitoring should consider different scenes and stages, and metrics should be interpreted in context.

Reference Materials

萧竹: Android App性能评测分析-流畅度篇

htkeepmoving: 移动APP性能评测-流畅度评测

腾讯: 【腾讯TMQ】GT3.1简化您的App性能测试(2)——原理讲解,溯本求源

微信读书: 卡顿监控系统

腾讯perfdog: PerfDog性能狗帮助文档

whbsspu: 为什么帧率达到60fps页面就流畅?

egos: Android中VSync机制的介绍

markzhai’s home: BlockCanary — 轻松找出Android App界面卡顿元凶(AndroidPerformanceMonitor)

Mobile DevelopmentAndroidframe rateVSyncSmoothness
Baidu App Technology
Written by

Baidu App Technology

Official Baidu App Tech Account

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.