Android Performance

Android Weekly Issue 2025-01

Word count: 2.7kReading time: 16 min
2025/01/06
loading

Android Weekly is a weekly newsletter focused on the Android technical ecosystem, updated every Monday. This newsletter delves into high-quality technical content in areas such as Android system architecture, performance optimization, cross-platform development, and AI, providing continuous knowledge updates and technical insights for developers.

You can subscribe and read through platforms like WeChat Official Account, Zhihu, Juejin, personal blogs, and Zhubai.

As the first issue of 2025, I will present a curated selection of highlights from the past year, covering both technical and non-technical fields. This issue touches on various aspects such as individual development, team building, official account operations, and personal blogging, aiming to provide more inspiration and value to readers. The content is quite extensive, so feel free to bookmark it and read at your own pace.

Technical Articles

  1. Performance Optimization Strategies for Large-Scale Apps: This article discusses performance optimization strategies for large-scale applications. Unlike small and medium-sized apps, large apps require a dedicated team to perform optimizations from a global perspective, focusing on how to manage resource usage by different business units, measure consumption, and implement better strategies when resources are tight. The article elaborates on these ideas using speed, fluidity, and memory optimization as examples.

  2. Using Perfetto to Locate App Startup Performance Bottlenecks: This article introduces how to use the Perfetto tool to identify bottlenecks in Android application startup performance. It details the two core metrics of startup time, TTID and TTFD, how to use Perfetto, and how to analyze common performance issues during startup, such as GC triggers, main thread time-consuming operations, long OpenDexFilesFromOat times, and continuous multi-frame drawing timeouts.

  3. Summary of Android Thread Performance Optimization Methods: This article summarizes methods for optimizing thread performance in Android, covering concepts of processes and threads, common problems, and optimization techniques. Common issues include process memory isolation and the relationship between process and thread IDs. Optimization techniques include reducing main thread workload and improving thread execution efficiency, such as avoiding AQS, reducing thread creation, lock elimination, and unconventional optimizations.

  4. Evolution and Practice of Browser Kernel Innovation - U4 5.0: This article introduces U4 5.0, the latest generation Web engine developed by the UC kernel team. It details the evolution and application of kernel engine technologies in rendering, JS engines, multimedia, and foundational technologies. Through optimizations like direct rasterization, direct composition, In-Renderer GPU, Code Cache, JS AOT, and U4 Snapshot, it enables Web apps to achieve app-level performance.

  5. Exploration of Android Kotlin Coroutines | JD Logistics Technology Team: An introduction to Kotlin Coroutines on Android, including concepts, relationships with other languages, problems they solve, and their working principles.

  6. How to Correctly Understand and Develop App Architecture: This article explores app architecture concepts, including the difference between modules and packages, layered architecture design, CQRS patterns, hexagonal architecture, and onion architecture, providing suggestions and best practices for common engineering issues.

  7. Evaluating Performance: This article presents a great logical framework for performance. Google categorizes performance issues into two types: capacity and noise. Capacity determines the maximum load, and methods to increase it include CPU/GPU frequency scaling, CPU cores online, thermal management, component optimization, and load reduction. Jitter is random noise; measures to reduce it include file pre-reading and app pre-warming. The article also covers measurement methods like TouchLatency and how to find jitter under low-frequency settings.

  8. How Large Companies Build Apps: Development Processes and Technologies Behind the Scenes: This article discusses common R&D processes and technical characteristics of large companies when building apps. It covers product requirements, R&D workflows, and technical implementations, analyzer common technical issues like componentization and frontend development.

  9. Android: Unexpected Ways to Capture and Utilize Main Thread Fragmented Time: By analyzing main thread stuttering in Android apps, this article proposes a solution to utilize main thread idle time for business logic. The scheme includes frame rate monitoring, idle time slicing, task decomposition, and intelligent task scheduling modules. This effectively utilizes main thread idle time, improving resource utilization and reducing stuttering for a better user experience.

  10. Practice of Sub-process Optimization and Governance in Xigua Android: This article describes the Xigua Video client team’s practices in optimizing sub-processes during the startup phase, including push, mini-program, downloader, and Sandboxed processes.

  11. WWDC 2021: Avoid hitches and discover the Render Loop: A summary of three WWDC 2021 videos regarding “Avoiding hitches and exploring the Render Loop.”

  12. Analysis and Practice of Android Stutter and ANR: This article introduces analysis practices for stutter and ANR in Android, including principles, the implementation and advantages of the monitoring tool LooperMonitor, and case studies of problem-solving with the tool.

  13. Analysis of Perfetto Data Flow Architecture Failures: Why Traces Get Lost: This article introduces the data encoding and transmission (Data Flow) architecture design of the Perfetto cross-platform system tracking and analysis platform. It explains potential reasons for data loss from this perspective and offers suggestions for mitigation. It also covers Perfetto’s basic architecture, including producers, consumers, and the IPC communication model, analyzing tradeoffs in observability overhead versus transmission reliability.

  14. Android vs. iOS Rendering Architecture: Which Wins?: A comparison of Android and iOS rendering architectures, noting that both higher layers avoid direct CPU drawing. The actual drawing is handled by Android’s SurfaceFlinger and RenderThread, and iOS’s render server. It emphasizes that low-level APIs like Metal and Vulkan have a greater impact on performance and compares their characteristics.

  15. Principles of DWARF-based Stack Unwinding in Android: This article introduces the principles of stack unwinding based on the DWARF standard in Android. It first covers frame pointer (FP) based backtracing and how compiler optimizations affect it. Then it deep-dives into .eh_frame and .debug_frame sections in DWARF, using readelf as an example to show how this information is parsed. Finally, it briefly mentions how simpleperf utilizes DWARF for event-based backtracing.

  16. Technology at Your Fingertips: Smartphone Touchscreen Technology and Power Optimization: This article introduces touchscreen working principles, classifications, working modes, and key parameters, while analyzing common power consumption issues and optimization strategies for capacitive touchscreens. It also provides power debugging methods.

  17. Birth of a Pixel: This article explains how a browser kernel renders web content into pixels, including HTML parsing, CSS processing, layout, drawing, rasterization, composition, and uploading. It details the working principles and optimization schemes for each step.

  18. On-Stack Replacement (OSR) in ART Virtual Machine: This article introduces On-Stack Replacement (OSR) technology in the Android Runtime (ART) virtual machine. ART has three compilation strategies: kBaseline, kOptimized, and kOSR. When an interpreted method is executed frequently, it triggers kBaseline compilation, but kBaseline code can only start from the method entry. OSR solves this by allowing execution to switch to optimized code mid-method (at loop back-edges).

  19. Comprehensive Analysis of Kernel Preemption Mechanism: A comprehensive look at the preemption mechanism in the Linux kernel, including its principles, implementation details, and impact on system performance and UX. It highlights the differences between three preemption models in Linux and how preemption solves issues like priority inversion.

  20. New Kernel Memory Stability Feature: Page Table Check Mechanism Interpretation: The kernel introduced the Page Table Check mechanism to detect memory corruption, specifically targeting long-standing memory reference count bugs.

  21. Kernel Scheduler Customization Tool: SCHED_EXT: This article introduces the SCHED_EXT extensible scheduler in the Linux kernel, which allows eBPF programs to modify scheduling strategies. It aims to make it easier for developers to experiment with and deploy custom scheduling strategies.

  22. Image Optimization Practice for Douyin Android: This article traces the journey of image optimization for Douyin Android, focusing on the self-developed BDFresco framework and its best practices, lessons learned, and business value.

  23. Speed Optimization: Fully Utilizing CPU Idle Time: An optimization scheme for utilizing CPU idle time to improve efficiency. It discusses methods to determine CPU idleness via proc node files or the times function, explaining the calculation and meaning of CPU consumption data.

  24. Experience and Insights from Taobao Page First Frame Optimization: Taobao shares experiences in optimizing the first frame of mobile pages, covering its importance (user affinity, conversion), definition/metrics (Loading views, main content, interactivity), analysis methods, and common optimization strategies (prefetching, lazy loading, parallel processing).

  25. Deconstructing GPU Performance Principles: Analyzing common GPU performance optimization myths from an architectural perspective, providing correct analysis methods for hidden surface removal, vertex shader efficiency, bandwidth bottlenecks, and branch prediction.

  26. Reflections on “Borrowing” from Apple Intelligence: This article explores Apple Intelligence, including its technical background, features, insights, and predictions for edge models. It notes how Apple Intelligence focuses on UX and emotional value while discussing the deployment of on-device models.

  27. Performance Optimizations in the vivo X200 Series: This article detailed optimizations in the vivo X200 series across CPU caching, scheduling algorithms, memory management, touch systems, and communication signals.

  28. Lock Optimization in Android System: Lock usage and optimization are vital in concurrent systems. This article uses AOSP source code cases to introduce common lock optimizations, addressing missing locks, over-locking, wrong locks, and lock coarsening/refining.

  29. Startup Optimization: Reviewing “Unconventional” Technologies: Discussing startup time optimization methods from redundant logic removal to unconventional strategies like APK resource reordering, proactive dex2oat triggers, GC suppression during startup, and persistence strategies.

  30. Can Game Frame Rates in Smartphone Launches Accurately Compare Fluency?: This article argues that average frame rate doesn’t fully reflect game fluidity and suggests more accurate ways to evaluate performance.

  31. Optimizing Android App Experience with ADPF Performance Hints: An introduction to performance hint within the Android Dynamic Performance Framework (ADPF) for optimizing thermal and CPU performance.

  32. Technical Analysis | Java Memory Barriers: From Theory to Implementation: An in-depth dive into Java memory barriers, their applications, and JVM implementations.

  33. About BangBang Security Software Crashes Caused by Android 15 GKI2407R40: Analyzing widespread crashes in apps using BangBang security on Android 15, identifying the root cause as a missing patch in the 7r40 kernel version.

  34. Tools, not Rules: become a better Android developer with Compiler Explorer: Encouraging developers to use Compiler Explorer to understand how Java and Kotlin code is compiled and optimized.

  35. GPU Performance Analysis on Mobile Platforms: A comprehensive guide to analyzing mobile GPU performance, including metrics like real-time overhead, bandwidth, and Shader Core performance.

  36. Analyzing Android Rendering Mechanism with Source Code and Perfetto: Analyzing the Android rendering process from multiple angles using source code and Perfetto.

  37. Reddit improved app startup speed by over 50% using Baseline Profiles and R8: How Reddit achieved major speed gains with Baseline Profiles and R8, alongside a migration to Jetpack Compose.

  38. WALT Scheduler: RTG (Related Thread Group): An introduction to Qualcomm’s RTG feature, which groups related threads (like Main and Render threads) to share cache or scale CPU frequency collectively.

  39. Don’t be a “Parrot” of Linux Kernel Code: This article argues for truly understanding kernel principles over just reading code.

  40. Android Native Problem Analysis: Quark and Douyin Unresponsiveness on Android 14: Analyzing scrolling unresponsiveness when multiple processes share a UID, tracing it to a bug in DisplayManagerService notification mechanisms.

  41. Flaws in Android Graphics Architecture: An analysis of inherent flaws in Android’s graphics architecture and proposed optimizations.

  42. Articles by Lu Banshan:

  43. Articles by Zhao Junmin:

  44. SimplePerf Series:

  45. Articles by Xiao Er Ge:

Non-Technical Articles

  1. Overseas Work for Programmers — Language Part: Sharing experiences on improving English for overseas work.
  2. So Long, and Thanks for All the Bytes: Chet Haase’s farewell article from Google’s Android team.
  3. Differences Between Chinese and Foreign Programmers.
  4. How Programmers Can Enhance Personal Technical Influence.
  5. What is the Essence of “Cost Reduction and Efficiency Increase”?: Arguing that the highest cost lies in decision-making, especially managerial ones.
  6. How We Learn?: Exploring how to combine guided and immersive learning with AI.
  7. Reading Notes: Outlive: A summary of the core principles of longevity science.
  8. First Principles Thinking: A Universal Framework for Problem Solving.
  9. First Principles Thinking: A Universal Framework for Problem Solving (Continued).
  10. Future Technical Trends.
  11. AI and Writing.
  12. Teach Yourself Programming in Ten Years.
  13. The Past and Present of OpenAI’s o1 Model.
  14. Follow — Another Form of Information Acquisition: How Follow and RSSHub change the way we collect info.
  15. Positioning Technology: Programmers are the Artisans of this Era.
  16. Comprehensive Interpretation: How Self-developed CPUs Became the Final Piece of the Snapdragon Puzzle.
  17. The Road of Independent Development in the AI Era.
  18. Programmer Anxiety: “I haven’t used it” and “I don’t know”.
  19. Insights from Ten Years of Programming.
  20. My Two Years in a Performance Team.
  21. Ordered Withdrawal from the Internet.

Personal Blog Updates

  1. Android Perfetto Series Index
  2. Android Perfetto Series Part 1: What is Perfetto?
  3. Android Perfetto Series Part 2: How to Capture Perfetto Traces
  4. Android Perfetto Series Part 3: Familiarizing with Perfetto View
  5. Review of 2023
  6. Android App ANR Series Part 2: ANR Analysis Routines and Key Logs
  7. Android App ANR Series Part 3: ANR Case Sharing

Android Developers’ News

I’ve created a Follow List for Android Developer News using the Follow app. It’s free, and everyone is welcome to subscribe.

Check out Follow — Another Form of Information Acquisition to learn more about the app.

Motivation

Ultimate Guide to Memory and Knowledge Retention!

Here are the strategies for effective memory and knowledge retention:

  1. Feynman Technique:

    • Choose a topic.
    • Explain it simply (to a child).
    • Identify gaps in your knowledge.
    • Refine your explanation for clarity and accuracy.
    • Self-test by further simplifying.
  2. Leitner System:

    • Convert hard topics into easy ones by gradually reducing review frequency.
  3. Active Recall:

    • Actively retrieve information to strengthen neural connections.
  4. Six Tips for Retention:

    • Diversified Resources: Use videos, books, notes, etc.
    • Establish Connections: Use analogies to link new info to familiar concepts.
    • Deep Understanding: Focus on the “why.”
    • Prioritize Health: Sleep, nutrition, and exercise.
    • Spaced Learning: Spread out study time.
    • Chunking: Break complex info into small pieces.

About the Author

  1. Personal Blog
  2. About Me: WeChat and WeChat group links.
  3. Android Performance Articles: A curated collection of performance optimization articles.
  4. Knowledge Planet: Join our community for deeper insights.
  5. WeChat Official Account:
  6. Zhihu
  7. Email Subscription
  8. Juejin
CATALOG
  1. 1. Technical Articles
  2. 2. Non-Technical Articles
  3. 3. Personal Blog Updates
  4. 4. Android Developers’ News
  5. 5. Motivation
  6. 6. About the Author