Quantcast
Channel: Just Total Tech » Android 4.4
Viewing all articles
Browse latest Browse all 3

ART : Strong surrogate of Dalvik

$
0
0

Google announced its new runtime on Android, ART, a strong replacement and successor for Dalvik. It is basically a virtual machine required for execution of Java code with the main purpose to improve performance of stock apps, third-party apps and core Android platform with improved battery life and other core metrics. Thus, Google has more advance JIT caching system now and it is declared that future android versions will use ART so developers should aware of it and make sure their code run very well with art. The applications having interaction with system’s core have differences in their performance when working with ART and Dalvik.

Dalvik and ART both  are the different runtimes executing instructions of applications inside Android where way of compilation and execution is different.  Dalvik is primarily a Just-in-Time (JIT) runtime that executes code only when application is running, ART which was firstly introduced in Android 4.4 KitKat uses an Ahead-of-Time (AOT)  compiler runtime that executes code before it is needed actually when the application is installed.

When talking about execution time and battery life both have incredible speed up. And other important metrics have improved significantly. The implications to  life of battery are significant since  during the runtime of an app there is no more JIT-work to be done. CPU cycles and power consumption is thus saved.

The performance and responsiveness is also improved through better garbage collection of ART and improved developer pages. The performance improvements can be shown easily from below graph:

ART : Strong surrogate of Dalvik

 

The significant performance gain over Dalvik exists as speed for code is improved two times running on VM.  ART vitual mahine is more than three times as fast as the same code running on the Dalvik. If a test iteration, running synchronously on its own thread on Dalvik,  takes about 1400 milliseconds to complete, the same test takes only about 400 milliseconds on ART. ART also used 2 MB less storage space.

ART improves the efficiency by making use of an entirely new memory allocator called Rosalloc which is runs of slots allocator which interferes with the garbage collector and other memory operations. Without locking, smaller objects which are common in Java are allocated in a thread-local region. Thus it doesn’t have to wait until the garbage collector frees an unrelated area of memory, when their is attempt by the application to allocate memory for a new object.

ART is completely compatible with “dex”, Dalvik’s executable byte-code format. And also, ART compiles an ELF executable. So, better memory management and less memory usage  is possible and kernel is now able to do page handling of code pages. CPU usage in ART is less than Dalvik who has to convert portable bytecode into executable code for the specific CPU in the phone every time when app launches. ART converts all the Apps bytecode into executable code for the specific CPU in the phone only once. Less CPU usage results in less battery drain, which is a big plus for portable devices today.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images