With Nexus 5 (Android 4.4 KitKat), Google has shipped two runtimes to run apps.
What are the differences between Dalvik & ART for endusers? How can endusers be affected by this? Is there any specific reason I should choose new ART runtime?
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.Sign up to join this community
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.
If ART is better on performance & battery life perspective, should I start using it?
No. If you do that, you may break third-party apps. Google has shipped this ART preview with Android 4.4 for developers to test their apps on it.
Side Note: Google's approach with ART is to beat iOS (iOS apps are native so performs better even on low-end hardware specs), but I don't know where it is heading... Another fragmentation? See OEMs are free to build devices using either one or both. While final version shouldn't affect most of apps, but its not 100% cross-platform thing.
1Note that JIT was added to Dalvik in Android 2.2