Blog Post

Google starts testing ART, a potential replacement for Dalvik in Android

Stay on Top of Enterprise Technology Trends

Get updates impacting your industry from our GigaOm Research Community
Join the Community!

After a 2010 spat over how Java works in Android(s goog) with Oracle(s orcl), Google is moving on to a new way for apps run on mobile devices. Dubbed ART, the new runtime environment is available as a preview option in Android 4.4. Developers are encouraged to try it and provide feedback for ART and if you have Android 4.4, you can test it yourself although you may not see much difference just yet.

On a sparse web page for developers, Google said the new runtime is experimental and a work in progress. You can enable it in Android 4.4 through the Settings, Developer Options menu. I did just that on a Nexus 5 and after a reboot, Android spent about 10 minutes optimizing my apps to run. I don’t yet see any difference in the apps.

Currently, Android apps run in what’s called Dalvik, a runtime environment that compiles Java bytecode “just in time” so that Android can run it. Essentially, it’s the software that lets you run software in Android. So what is ART and why should you care? Check this overview from Cody Toombs at Android Police for a better understanding:

“ART, which stands for Android Runtime, handles app execution in a fundamentally different way from Dalvik. The current runtime relies on a Just-In-Time (JIT) compiler to interpret bytecode, a generic version of the original application code. In a manner of speaking, apps are only partially compiled by developers and the rest of the compilation is completed on a user’s device each and every time they are run. The process involves a lot of overhead and isn’t particularly efficient, but the mechanism makes it easy for apps to run on a variety of hardware and architectures. ART is set to change this process by pre-compiling that bytecode into machine language when apps are first installed, turning them into truly native apps. This process is called Ahead-Of-Time (AOT) compilation. By removing the need to spin up a new virtual machine or run interpreted code, startup times can be cut down immensely and ongoing execution will become faster, as well.”

Coombs said that Google has been working on ART in secret for two years and I have no reason to think otherwise. In fact, it was just under two years ago — May of 2012 — that the courts decided Google didn’t infringe on Oracle’s Java-related patents. So while ART may have been planned to speed up Android apps, I wouldn’t be surprised to hear that it got started because of the Oracle suit.

Regardless of how it was born, it’s coming to Android at some point. Coombs plans some follow-up thoughts on ART in the coming days and I’m looking forward to hearing more. After all, anything that could bring app speed and efficiency to Android is worth watching out for.

Update: This post was updated at 6:21am PT, Nov. 7 to correct the time frame of the court decision.

17 Responses to “Google starts testing ART, a potential replacement for Dalvik in Android”

  1. pentiger

    I switched to ART on my Nexus 5 and I now regret it. Before in Antutu I had 29555 after switching to ART I benchmark-ed at 15500 I was disappointed and actually I noticed lag and skips when scrolling webpages on ART so I switched back to Dalvik and now benchmark shows 16200. WTF!!!!

    I will have to do factory reset now.

    So if anyone plans to do it on their nexus I highly NOT recommend it.

    • Sewer56lol

      It’s because your CPU is being throttled on the Nexus 5.

      ART is only about how code is interpreted in loading parts of the app, it should not majorly affect the performance inside the app. It won’t change benchmark scores.

      I reccommend you research the word “mpdecision”. You will only be able to take a proper benchmark without it in your kernel.

      The Nexus 5 should bench at about 32000

  2. If I recall (it’s been a while), byte code is very memory efficient. Won’t compiling at installation time increase storage requirements? Any figures from those who’ve been able to use ART?

  3. This has nothing to do with the Oracle law suit. Oracle was suing for the use of java APIs. That doesn’t change at all with ART. They have got nothing on dalvik.

  4. I did this on my Nexus 5 and it sent it into a boot loop after rebooting. Looking at logcat, mm-camera keeps crashing. Not sure why it didn’t work properly on mine.

  5. Mike Cerm

    I have always been disappointed by Android’s inability to run native code. When you look at the iPhone, with it’s tiny battery and comparatively slow dual-core processor, and then you see it run circles around all but the latest quad-core Snapdragon 800 phones (which run over 1GHz faster than the A7), you can really see just how slow and inefficient Android is. I hope ART can help bridge that gap.