Google today detailed how it spent the past two years improving the performance — especially on Speedometer — of Chrome for Android.
To track browser performance, Google uses the Speedometer benchmark as it is “most reflective of the real world.” This metric “measures how quickly Chrome can complete interactions with web pages, including parsing/rendering HTML or CSS and running JavaScript.”
Since Chrome 112 in April of 2023, Google says there’s been a “significant increase in Speedometer 2.1 scores on Android.” (Version 3.0 was released this year.) Back then, “loading a Google Docs document on Pixel Tablet took more than 50% longer than it does today.”
In fact, on many devices, scores more than doubled, with the newest Snapdragon 8 Elite Mobile Platform setting new records for Speedometer performance on mobile devices!
The Chrome team credits updates in three areas, starting with build optimizations that account for over “half of the overall Speedometer score improvements.” With version 113 last year, Google shipped a “separate higher-performance build targeting premium Android devices” after years of just one build that prioritized a small binary size for entry-level phones. (There’s still a “more binary-size-constrained build” today for other devices.)
The new “premium build” has modern optimizations, which result in larger binaries, with Google noting “direct contributions from our partners at ARM.” These include:
- By targeting ARM64 instead of ARM32, we can make use of more efficient ARM instruction set features and larger 64-bit operations.
- Since binary size is less relevant on premium devices with large disks and sufficient memory, we can now compile C++ code optimized for speed (-O2 / -O3) rather than size (-Oz).
- Furthermore, we tweaked the inlining thresholds used by the compiler to enable more inlining in hot code (within and across modules), while updating the model and policy used by another compiler pass (MLGO) to reduce inlining in cold code.
- We now also apply profile-guided optimization (PGO) techniques to the build to further improve the code layout and optimization level for hot code.
- Finally, we improved cross-function code ordering by aligning Chrome’s orderfile generation with the new ARM64 build. We also now include Speedometer 3, the latest version of the industry-standard browser speed benchmark, in the workloads used to generate the orderfile.
Then there are improvements to the V8 JavaScript engine and Blink rendering engine:
- We now utilize an optimized fast-path HTML parser to parse innerHTML attributes.
- V8 launched its Sparkplug compiler tier, a super fast baseline compiler that sits right above its Ignition interpreter and generates non-optimized code very quickly. Later, V8 also launched Maglev, a new mid-tier compiler that generates semi-optimized code. It takes longer to do so than Sparkplug, but much less time than Turbofan, V8’s ultra-optimizing compiler tier. All together, this new tiering hierarchy allows V8 to tier up more gradually, improving both performance and power consumption.
- We tuned our heuristics that decide when garbage collection occurs, targeting times when the rendering engine is idle or when users navigate away from pages.
- We landed many other incremental optimizations, e.g. to V8 and our parsing, style, layout, and text rendering engines.
The final improvements were brought about by working with Android partners to “optimize the way Chrome interacts with the operating system and its thread scheduling to make the best use of the silicon on the devices,” especially Qualcomm:
By combining optimized scheduling policies with improved hardware performance, their newest Snapdragon 8 Elite mobile platform realized a 60-80% improvement in Speedometer 3.0 compared to its predecessor, resulting in class-leading web performance on mobile devices.
FTC: We use income earning auto affiliate links. More.
Comments