Click here to Skip to main content
Click here to Skip to main content

Android New Runtime ART

, 13 Jun 2014
Rate this:
Please Sign up or sign in to vote.
New Runtime in Android operating system Kit Kat version (Android 4.4)

Introduction

Google has introduced “ART” a new Android runtime experimentally in the 4.4 release (Kit Kat).

Description

Google has been continuously introducing new features from version to version. In Kit Kat Android version 4.4, it has improved a performance of Android application execution by introducing new experimental android runtime “ART”.

Android apps are deployed in Dalvik bytecode, which is portable, unlike native code. To run the app on a device, the code has to be compiled to machine code.

Kit Kat is the first Android operating system version which has two Android runtimes variants

  • Dalvik
  • ART

Dalvik works based on "JIT" Just In Time compilation. When each time you run an app, the part of the code required for its execution is going to be compiled to machine code at that moment. As you progress through the application, additional code is going to be compiled and cached. System can reuse the code while the application is running. JIT compiles only a part of the code, so it has a smaller memory footprint and uses less physical space on the device.

ART works like compiles the intermediate language --> Dalvik bytecode --> into a system-dependent binary code. Complete code of the application will be pre-compiled during install once, thus removing the lag that is seen when we open an application on our device. With no need for JIT compilation, the code should execute much faster compared to Dalvik runtime.

Other than the speed increase, using of an ART can provide an most important secondary critical benefit for mobiles / portable devices. ART runs application machine code directly (i.e, native execution), it doesn't utilize CPU as hard as just-in-time code compiling on Dalvik. Less CPU usage results in less battery drain, which is a big plus for mobile devices in general where lot of user looking while choosing mobile to buy.

Major drawback with ART is generated machine code (i.e., Native code) requires more space compared to the existing bytecode. The code is pre-compiled at install time, so the installation process takes a bit longer. Furthermore, it also corresponds to a larger memory footprint at execution time. This means that fewer applications run concurrently. Now a days memory is much cheaper in cost and even on low-end devices have more enough RAM and ROM , so ART is a logical step forward for new Android versions.

This is a preview of work in progress in KitKat that can be turned on in Settings -> developer options -> Select runtime -> Use ART -> ok to reboot as shown.

Settings

developer options

Select runtime

 Use ART

After reboot when the mobile is booted up, Android mobile will run with new runtime ART. As an Android developer each time when I made a little change, I wanted to test installed new application instance on the device. As stated earlier ART uses Android One Time compilation, which prolongs the install times of applications because the Dalvik bytecode gets compiled to machine code. Each time for deploying new version of the application on to my testing mobile device needs to wait for additional time to pass so that the app optimizes for the ART runtime. This causes a significant delay in the deployment process. In my application development process, one of our larger projects jumped from 27 sec to 39 sec.

Points of Interest

Coding wise, it's the same for normal Android application development with both runtimes. My quick overview of the results observed with new runtime ART on Google's Motorolo Android device "Moto G" is increased speed in CPU arithemetic operations, RAM operations and storage operations which results in overall 20% average increase in the speed.

While playing games, I also observed the smoothness and touch response improved very much.

History

  • 11th June, 2014: Initial version

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

No Biography provided

Comments and Discussions

 
Questionbeware of phone incompatibility risk PinmemberRabinDl23-Jun-14 21:36 
AnswerRe: beware of phone incompatibility risk PinmemberMember 1058259724-Jun-14 14:55 
GeneralMy vote of 5 PinmemberAbinash Bishoyi22-Jun-14 23:40 
Generalby using this article I to tried in moto e few games performance has been increased ............ Pinmemberraju k21-Jun-14 3:10 
GeneralMy vote of 1 PinmemberMember 376270219-Jun-14 11:41 
GeneralMy vote of 1 Pinmemberoliver.stockleyOpenGI17-Jun-14 5:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 13 Jun 2014
Article Copyright 2014 by Member 10582597
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid