
What is Dalvik.?
Dalvik is the process virtual machine (VM) in Google's Android operating system. It is the software that runs the apps on Android devices.
Most of the apps that run on Android are written in Java. Applications written in Java require the Java Virtual Machine (JVM) to run, but Google has chosen to abandon the both Java Virtual Machine (JVM) and Java Micro Edition (JME) in favour of Dalvik Virtual Machine. Why did Google take the alternative instead of using the Java Virtual Machine.? Licensing. The Java language, Java tools and Java libraries are all free but not the Java Virtual Machine. The license for Java Virtual Machine is free and Open Source, but when used on a mobile device using a JME, it is not.
How does it work.?
A standard Java compiler turns source code (written as text files) into Bytecode, then compiled into a .dex file that the Dalvik VM can read and use. Still Confused.!!
Think of it this way -- when you make a java application for computer, a JVM reads the code and executes it to give the output. Thus the work of reading the code is done by the Virtual Machine instead of the OS on which it runs. This is the reason Java runs on just about any Operating System. Dalvik is the mobile optimised version of the Java Virtual Machine, and designed for easier multi-tasking.
Oracle (who bought Java from Sun Micro Systems) is not happy with Google's of Java and Dalvik. While Oracle claims Google to have used Oracle's code for Dalvik, Google denies.
Dalvik used Just-In-Time (JIT) compilation of the programs (or Apps-as we know them now). That means, each time you opened an app, its code was to be compiled into byte-code to be executed. Yes.! Everytime you use that app. This results in increased opening time of the apps. Not to forget everytime.

ART and its Working.
When Google launched Android Kitkat, ART happened. ART which stands for Android RunTime, was introduced as an experimental feature when Kitkat launched. ART used Ahead-Of-Time (AOT) compilation. In simple language, the entire code of the app will be compiled only once during the installation of the app. With no need for JIT, the code should execute much faster. (Almost twice as fast as Dalvik according to Google).
Except for the speed increase, the use of ART provides another benefit. As ART directly runs byte-code, it doesn't hit the CPU as hard as JIT. Less CPU usage ultimately results in less battery drain which is a big plus for portable devices.
What are the downsides of ART.?
ART uses Ahead of Time compilation. Meaning that all the code of your app is compiled into byte-code when it is installed on your device. As the code needs to be compiled during installation, it increases the installation time of apps. Also note that the whole app is compiled into byte-code unlike Dalvik that compiled only a part of the program, This results in larger memory foot-print of the apps. This ultimately reducing multi-tasking capabilities as more memory is used. (Unless we get 64bit Android with mammoth amount of RAM in mobile devices).
But there are Benefits that overcome the downsides.
While ART reduces multi-tasking ability, it does show faster multi tasking. Confusing, right.? This just means that you can run less apps at once but those running can run faster than before.

Benchmarks show a significant improvement in CPU, RAM and Storage operations. There's one more benefit of ART. When iPhone users are asked for their opinion about Androids, they often complain about Android being laggy, despite the fact that Android is better in terms of raw hardware specs. This lag is the result of JIT which disappears significantly after switching to ART.
Looking at the benefits of ART, it makes me pleased as punch to see ART come out of experimental phase and replace Dalvik as the Default RunTime for Android. With Google IO about a week away, I hope to see Google launch the L word Android all with a redesigned UI as seen in leaks with ART running the show.
What are your thoughts about ART.? Any good.?
Looking at the benefits of ART, it makes me pleased as punch to see ART come out of experimental phase and replace Dalvik as the Default RunTime for Android. With Google IO about a week away, I hope to see Google launch the L word Android all with a redesigned UI as seen in leaks with ART running the show.
What are your thoughts about ART.? Any good.?
No comments:
Post a Comment