`

Android Kitkat ART vs. Dalvik & Impacts for end-users

阅读更多
What's ART?

ART is Google's 2-year-long ongoing secret project, which aims to boost the performance of our Android devices. It's based on the premise that modern devices are pretty powerful in terms of CPU speed and memory capacity, especially in comparison with the first generation of Android devices.

ART is still an ongoing project, considered too unstable to be introduced as a standard runtime.
You can choose to use it by going to "Settings > Developer Options > Select Runtime" and choosing ART.

ART vs. Dalvik / AOT vs. JIT

Dalvik VM (Virtual Machine) is Google's version of a Java VM (on which apps run). VMs keep apps isolated and independent from actual hardware and other apps. But, for this to work, Dalvik needs to convert so called bytecode (designed for virtual machine) to native machine code. In order to minimize the performance penalty that the bytecode to native code conversion introduces, a process called Just-In-Time (JIT) compilation is performed, which converts hot, i.e. often used, bytecode to native code.1

ART (Android Runtime) is a replacement for Dalvik that uses Ahead-Of-Time (AOT) compilation, meaning your apps are compiled to a ready-to-run state before you even launch them. This is usually done, at the time of app installation, making the process of launching and using them much faster and smoother. And since this means that compilation is only done once, you may also see better battery life, too.

Impacts for end-users


ART is better on performance & battery life perspective, but you may not start using it, because ART is not fully functional with Android Kitkat. Google has shipped the ART perview with Android Kitkat for developers to test their apps on it. Maybe ART will fully functional with Android 5.0, Google's approach with ART is to beat iOS, that's the point.

Build device using ART


Two runtimes are now available, the existing Dalvik runtime (libdvm.so) and the ART (libart.so). A device can be built using either or both. (You can dual boot from Developer options if both are installed.)

A new PRODUCT_RUNTIMES variable controls which runtimes are included in a build. Include it within either build/target/product/core_minimal.mk or build/target/product/core_base.mk.

Add this to the device makefile to have both runtimes built and installed, with Dalvik as the default:
PRODUCT_RUNTIMES := runtime_libdvm_default
PRODUCT_RUNTIMES += runtime_libart
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics