跪拜 Guibai
← All articles
Uni-app · iOS · Android

DCloud's uni-app x Steam Mode Posts 2x Rendering Speed Gains Over Native Android View

By CHB ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A cross-platform framework that consistently doubles native rendering throughput on Android upends the standard trade-off between developer productivity and runtime performance. Teams targeting both iOS and Android can now ship a single Vue codebase without paying the usual frame-rate or memory penalty, and the compiled machine-code approach sidesteps the overhead that has made Compose UI slower than the old View system.

Summary

DCloud's uni-app x Steam Mode removes the virtual DOM and compiles templates and styles directly into machine code or bytecode. On a Xiaomi Fold4 running Android 16, the framework created 2,000 nested views and text elements in 229 ms after AOT optimization, while native Android View took 462 ms and Compose UI took 626 ms. Memory usage was also lower: 41 MB for uni-app x versus 79 MB for native View and 124 MB for Compose UI.

A "deadly long list" stress test loaded 4,000 rows of deeply nested content with images, video, shadows, and rounded corners. uni-app x maintained an average 109 fps during fast scrolling. Native RecyclerView managed 45 fps, and Compose UI reached 51 fps. The framework's canvas component pushed 20,000 colliding balls at full frame rate, while React Native Skia dropped below 60 fps at 2,000 balls on the same device.

All test code, APKs, and Perfetto traces are public. The benchmarks controlled for CPU core scheduling, JIT warm-up, and AOT compilation state, with separate measurements for first install and idle-optimized conditions.

Takeaways
uni-app x Steam Mode renders 2,000 nested views and text elements in 229 ms after AOT optimization, while native Android View needs 462 ms and Compose UI needs 626 ms.
Memory increase after rendering 4,050 elements is 41 MB for uni-app x, 79 MB for native View, and 124 MB for Compose UI.
In a 4,000-row long list with 40+ elements per row, uni-app x averages 109 fps; native RecyclerView averages 45 fps and Compose UI averages 51 fps.
The framework's canvas handles 20,000 colliding balls at full frame rate on a Snapdragon 8 Gen 3, while React Native Skia drops below 60 fps at 2,000 balls.
Templates and styles compile directly to machine code or bytecode; the virtual DOM is removed entirely.
All benchmarks were run on unrooted Xiaomi Fold4 devices with Perfetto traces confirming code stayed on performance cores, not the prime core.
Separate measurements cover first-install and idle-optimized (AOT) states, with both APKs and source code published for reproduction.
Conclusions

Compose UI's declarative model was supposed to modernize Android rendering, but these numbers show it is materially slower than the old View system it was meant to replace, which explains why many large apps have been slow to migrate.

The decision to build custom components instead of wrapping Android's TextView and RecyclerView is the architectural move that lets uni-app x bypass the accumulated overhead of the platform's standard widgets.

Compiling Vue templates to machine code rather than interpreting a virtual DOM diff at runtime is the single largest factor in the speed gap; it turns a framework-level abstraction into a build-time optimization.

Android's aggressive power management means the prime core rarely activates in real-world use, so benchmarks that rely on it overstate typical performance. This test explicitly discards any run where the prime core fired, making the results more representative of daily usage.

Concepts & terms
Steam Mode
A compilation mode in uni-app x that removes the virtual DOM and compiles Vue templates and styles directly into machine code or bytecode, eliminating the runtime diffing overhead that slows traditional declarative UI frameworks.
View flattening
An optimization where nested UI elements are collapsed into fewer actual rendering nodes, reducing the layout and draw cost. uni-app x supports both flattened and non-flattened rendering, with flattening enabled by default.
AOT (Ahead-of-Time) compilation
Android's idle-time optimization that pre-compiles app bytecode into native machine code, typically triggered while the device is charging and idle. This benchmark tests both pre-AOT and post-AOT states to reflect real user conditions.
Perfetto
Google's system-wide profiling tool for Android that captures CPU scheduling traces. The benchmark used Perfetto to verify that test code ran on performance cores and to discard runs where the prime core was accidentally activated.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗