Google wants to make Android faster through kernel optimizations
Google wants to make Android faster and more efficient through kernel optimizations. Users should get more responsive devices with longer battery life.
(Image: Andreas Floemer / heise medien)
Google is introducing a new optimization trick to make Android's Linux kernel run faster. To achieve this, the system analyzes how smartphones and apps are used in everyday life and then reorganizes Android's code. This is intended to make the most frequently used components run more efficiently. To achieve this, the Android LLVM toolchain team (LLVM formerly stood for Low Level Virtual Machine) will integrate automatic feedback-driven optimization (AutoFDO) into the kernel.
Optimizations at the core
In a blog post on the Android Developers Blog, the LLVM toolchain team explains that the LLVM compiler makes thousands of small decisions during standard software creation, for example, whether a function should be inlined and which branch of a condition is likely to be taken, based on static code hints. “While these heuristics are useful, they don't always accurately predict code execution during real-world phone usage,” the developers say.
Videos by heise
AutoFDO, on the other hand, uses real execution patterns to control the compiler. According to Google, “These patterns represent the most common instruction execution paths the code takes during actual use, captured by recording the CPU's branching history.” It goes on to say that while this data can be collected from fleet devices, Google synthesizes it during development for the kernel in a laboratory environment using representative workloads, such as running the 100 most popular apps.
The LLVM toolchain team uses a sampling profiler to capture this data and identify which parts of the code are used frequently and which are used less often. “When we rebuild the kernel with these profiles, the compiler can make much smarter optimization decisions tailored to actual Android workloads,” says Google.
Google follows a “conservative by default” strategy with this technology, which the manufacturer wants to ensure improves speed without compromising other areas such as reliability.
Advantages
According to Google, the advantages of the process are clearly measurable: Internal tests on Pixel devices showed a one percent reduction in operating system boot time and an improvement of around four percent in app cold starts. In practice, these changes lead to “a snappier interface, faster app switching, extended battery life, and an overall more responsive device for the end user,” Google explains.
(Image:Â Google)
The Android kernel is one of the most important components of Google's mobile operating system. It forms the core of Android, so to speak, and controls the communication between the CPU, apps, and hardware. According to Google, the kernel accounts for about 40 percent of the CPU processing time on Android devices. Consequently, even small optimizations can have an impact on a smartphone's performance.
AutoFDO is currently provided via the Generic Kernel Image in the kernel branches android16-6.12 (Linux kernel 6.12 for Android 16) and android15-6.6. Support is also to be extended to newer GKI versions, such as the upcoming version android17-6.18. Google is also interested in extending AutoFDO to manufacturer modules created with the Driver Development Kit (DDK). The “generic kernel image” was introduced with Android 11 and is intended to resolve kernel fragmentation.
(afl)