Android Runtime (ART) vs Dalvik


Android Runtime (ART) vs Dalvik

A blog posted by Ryan

If you've got a Nexus 5, or are lucky enough to have KitKat rolled out to your phone, you may have noticed the inclusion of the new Android Runtime (ART). This is an experimental runtime developed by Google that could be a game changer in terms of Android performance. It's already being touted as twice as quick as the Dalvik runtime. When you look at how it works, this makes sense, it takes advantage of ahead of time compilation to run all your apps natively! Up until now Dalvik has been the only runtime available and uses a more traditional just in time (JIT) compilation, meaning you're running interpreted code, which takes more processing to compile on the fly.

But to be honest, the Nexus 5 is fast, and I would be hard pressed to know which runtime was enabled in general usage. It may be more noticeable on less powerful devices, or with intensive apps, but with general use I can't tell the difference. That is until you compare battery life!

Battery life seems to be night and day between the 2 runtimes. I've been getting barely 14 hours battery life from my Nexus 5 while using Dalvik. That's with pretty light use, bit of browsing, few messages and the odd call. By no means heavy, but I feel like I always need to be near a charger. I've switched to the ART runtime and after 14 hours I've still got 70% battery. That's amazing! It's only been a couple if days so far, but the usage has been about the same but with hugely improved battery life.

So if you're struggling with battery life, and have KitKat I'd recommend making the switch. It is currently experimental, so it may break some 3rd party apps. If this is the case you can easily switch back to Dalvik. Or if your me, find alternative apps that do work, as I'm not giving up the improved battery life!

To switch to ART you need to enable Developer Options by going to Settings > About Phone, and tapping on Build Number 7 times. Then when you click back to Settings you should see a new option Developer options where you can switch runtimes.