New Android Run-time , ART in KitKat

ART, which stands for Android Runtime, handles app execution in a fundamentally different way from Dalvik. The current run-time relies on a Just-In-Time (JIT) compiler to interpret bytecode, a generic version of the original application code. In a manner of speaking, apps are only partially compiled by developers, then the resulting code must go through an interpreter on a user's device each and every time it is run. The process involves a lot of overhead and isn't particularly efficient, but the mechanism makes it easy for apps to run on a variety of hardware and architectures. ART is set to change this process by pre-compiling that bytecode into machine language when apps are first installed, turning them into truly native apps. This process is called Ahead-Of-Time (AOT) compilation. By removing the need to spin up a new virtual machine or run interpreted code, startup times can be cut down immensely and ongoing execution will become faster, as well.

ART is a new Android runtime being introduced experimentally in the 4.4 release. This is a preview of work in progress in KitKat that can be turned on in Settings > developer options. This is available for the purpose of obtaining early developer and partner feedback.

Google purchased the French company Flexycore (ART developed in). While Flexycore has nothing to do with ART, the purchase and ART compiler show Google’s renewed focus on improving device performance.

Switching from Dalvik to ART switches from the libdvm.so library to libart.so. And rather than the ODEX files read by the Dalvik VM, ART appears to use OAT files. Accordingly, Android 4.4 source also includes a dex2oat program to convert ODEX files into OAT files compatible with ART.


https://android.googlesource.com/platform/art/+/kitkat-release/dex2oat/dex2oat.cc


Select Runtime


Use ART
For now, the potential gains in efficiency are difficult to gauge based on the version of ART currently shipping with KitKat, so it isn't representative of what will be possible once it has been extensively optimized. Thus far, estimates and some benchmarks suggest that the new runtime is already capable of cutting execution time in half for most applications. This means that long-running, processor-intensive tasks will be able to finish faster, allowing the system to idle more often and for longer. Regular applications will also benefit from smoother animations and more instantaneous responses to touch and other sensor data. Additionally, now that the typical device contains a quad-core (or greater) processor, many situations will call for activating fewer cores, and it may be possible to make even better use of the lower-powered cores in ARM's big.LITTLE architecture. How much this improves battery life and performance will vary quite a bit based on usage scenarios and hardware, but the results could be substantial.

Warning: Do not try this with the Paranoid Android (or other AOSP) build right now. There is an incompatibility with the current gapps package that causes rapid crashing, making the interface unusable.

Update: More information on ART can now be found on the Android Source Code Documentation Website. (but still [2013-11-27] very few details in that site - )

Comments

Popular posts from this blog

Brother printer password reset using telnet

How to adjust the brightness in Samsung 19" SyncMaster SA100 LED monitor?

ASP.NET Server Controls Tutorial