Why is ART better than Dalvik?

ART(Android RunTime) is the next version of Dalvik. Dalvik is the runtime, bytecode, and VM used by the Android system for running Android applications.

ART has two main features compared to Dalvik:

Ahead-of-Time(AOT) compilation, which improves speed (particularly startup time) and reduces memory footprint (no JIT)

Improved Garbage Collection (GC)

AOT means your apps are compiled to native code once. What is stored on your phone and run is effectively native, not bytecode. This differs from the traditional VM model, while interprets bytecode. Interpreters are slow, so VM developers added a technology colled Just-in-Time(JIT) compilation, which compiles (and hopefully optimizes) your code to native code on-the-fly. Dalvik is a JIT’ing VM. The downside to JIT is that the JIT compiler runs while you are using your app, adding latency and memory pressure. The upside is that the JIT compiler can look at how your are using your code to perform profile-directed optimizations.

AOT is like JIT, but it runs once–say, at app installation time. While it lacks the ability to perform profile-directed optimizations, it is possible to perform more extensive optimizations since the compilation is less time sensitive. AOT is useful on systems, such as mobile devices, where JIT adds an unacceptable latency or memory cost to running apps. I think AOT is the right step for Android and ART looks quite impressive.

ART was first included in Android KitKat, but isn’t yet enabled by default. You can enable it via Settings > Developer options > Select runtime > Use ART.