How Baidu Optimized Low‑End Device Startup Performance: A Deep Dive
This article explains how Baidu's performance team tackled the slowdown of mobile internet growth by defining low‑end devices, building observability, creating high‑efficiency tooling, redesigning key components such as KV storage and locks, and introducing a smart scheduling framework that together reduced Android cold‑start TTI by over 50% and iOS cold‑start TTI by more than 40%, while establishing a continuous anti‑degradation pipeline.
Background
With the mobile internet user base reaching its peak, growth has slowed and companies are shifting focus from acquiring new users to retaining existing ones. Low‑end devices, which make up a significant portion of the retained user base, have become a critical performance bottleneck for apps such as Baidu App.
Goals and Value
The project aims to improve user experience on low‑end phones by optimizing startup performance, establishing a performance‑driven design, creating reliable problem‑location mechanisms, and building a full performance‑optimization loop.
Key Challenges
Complex startup flow leads to severe black‑screen and stutter issues on low‑end devices.
Lack of an overall scheduling mechanism for numerous pre‑load tasks.
High cost of locating performance problems with existing tools.
Insufficient anti‑degradation mechanisms, relying only on partial online metrics and user feedback.
Approach Overview
The solution is split into three sub‑directions: observability facilities, core infrastructure, and business‑level optimizations.
1. Observability Facilities
Define low‑end devices using a scoring system (static + dynamic scores) where devices with PV/UV share <15% are classified as low‑end.
Build startup performance metrics, primarily Time‑to‑Interactive (TTI), adapted from web metrics (FCP, FID) to mobile.
Establish online and offline anti‑degradation pipelines to detect regressions early.
2. Core Infrastructure
High‑Efficiency Performance Tools : Developed a Trace tool (ASM‑based instrumentation + Perfetto) and a Hook tool (Epic/XHook based) for visualized, automated analysis of lock contention, long tasks, I/O, and thread issues.
High‑Performance KV Storage (UniKV) : Replaced Android SharedPreferences with a multi‑process, non‑blocking KV store supporting strong typing, data migration, and reduced thread usage, achieving up to 95% faster first‑read performance on low‑end phones.
Lock Optimization : Refactored ABTest component to eliminate synchronized blocks, introduce lock‑free reads, and use JSON/PB formats for cached data, cutting TTI by >200 ms.
Scheduling Framework : Designed a task scheduler that accepts business‑defined tasks, gathers device, behavior, and scene profiles, and provides personalized, tiered, and priority‑based execution, enabling fast integration of pre‑load optimizations and parallel rendering of splash screens and home pages.
3. Business Optimization
Problem discovery via Trace/Hook tools (offline) and online metrics/experiments (online).
Collaboration with product teams to prioritize fixes, schedule releases, and validate impact.
Verification of optimizations through regression testing and monitoring of both performance and business KPIs.
Results
The combined effort delivered measurable improvements:
Cold‑start TTI on Android reduced by >50 % and on iOS by >40 %.
First‑launch TTI on Android improved by ~40 % and on iOS by ~30 %.
ABTest lock contention eliminated, yielding a 200 ms+ TTI gain.
UniKV adoption across >100 files, reducing thread count and eliminating ANR cases.
Future Outlook
Continued investment will expand beyond startup to the full app lifecycle, focusing on view‑system smoothness, automated anti‑degradation pipelines, and broader adoption of the scheduling framework across more scenarios such as splash screens, external launches, and core feed rendering.
References
Web FID: https://web.dev/fid/
Epic (hook framework): https://github.com/tiann/epic
xHook: https://github.com/iqiyi/xHook
Perfetto docs: https://perfetto.dev/docs/
MMKV: https://github.com/Tencent/MMKV
Booster: https://github.com/didi/booster
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
